diff --git a/Assets/MixedRealityToolkit.Generated/CustomProfiles/SpeechCommandsProfile.asset b/Assets/MixedRealityToolkit.Generated/CustomProfiles/SpeechCommandsProfile.asset index a07ea05..541cdec 100644 --- a/Assets/MixedRealityToolkit.Generated/CustomProfiles/SpeechCommandsProfile.asset +++ b/Assets/MixedRealityToolkit.Generated/CustomProfiles/SpeechCommandsProfile.asset @@ -121,3 +121,10 @@ MonoBehaviour: id: 0 description: None axisConstraint: 0 + - localizationKey: + keyword: "\u30CA\u30D3\u30B2\u30FC\u30B7\u30E7\u30F3" + keyCode: 0 + action: + id: 0 + description: None + axisConstraint: 0 diff --git a/Assets/prefabs/Indicator.prefab b/Assets/prefabs/Indicator.prefab new file mode 100644 index 0000000..6f9acb5 --- /dev/null +++ b/Assets/prefabs/Indicator.prefab @@ -0,0 +1,362 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &22808980527028979 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 22808980527028977} + - component: {fileID: 22808980527028978} + m_Layer: 0 + m_Name: Indicator + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &22808980527028977 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 22808980527028979} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -0.2, z: 2} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 22808981331449236} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &22808980527028978 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 22808980527028979} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 58a1a5b5eb3404a4f9870eed7e785e21, type: 3} + m_Name: + m_EditorClassIdentifier: + targetObject: {fileID: 0} + indicatorObject: {fileID: 22808980527028979} + forwardOffset: 1.5 + heightOffset: -0.3 +--- !u!1 &22808981236268858 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 22808981236268857} + - component: {fileID: 22808981236268806} + - component: {fileID: 22808981236268807} + - component: {fileID: 22808981236268856} + m_Layer: 0 + m_Name: Cube (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &22808981236268857 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 22808981236268858} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -0.09619999} + m_LocalScale: {x: 0.1, y: 0.01, z: 0.3} + m_Children: [] + m_Father: {fileID: 22808981331449236} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &22808981236268806 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 22808981236268858} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &22808981236268807 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 22808981236268858} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 3c55769e893c4f4c8c51b7fa69bee2b9, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + 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!65 &22808981236268856 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 22808981236268858} + 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!1 &22808981331449237 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 22808981331449236} + m_Layer: 0 + m_Name: Arrow + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &22808981331449236 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 22808981331449237} + 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: 22808981236268857} + - {fileID: 22808981578538989} + - {fileID: 22808981849161443} + m_Father: {fileID: 22808980527028977} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &22808981578538990 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 22808981578538989} + - component: {fileID: 22808981578538986} + - component: {fileID: 22808981578538987} + - component: {fileID: 22808981578538988} + m_Layer: 0 + m_Name: Cube (2) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &22808981578538989 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 22808981578538990} + m_LocalRotation: {x: -0, y: 0.38268343, z: -0, w: 0.92387956} + m_LocalPosition: {x: -0.035, y: 0, z: 0} + m_LocalScale: {x: 0.10000001, y: 0.01, z: 0.20000002} + m_Children: [] + m_Father: {fileID: 22808981331449236} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 45, z: 0} +--- !u!33 &22808981578538986 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 22808981578538990} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &22808981578538987 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 22808981578538990} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 3c55769e893c4f4c8c51b7fa69bee2b9, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + 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!65 &22808981578538988 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 22808981578538990} + 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!1 &22808981849161444 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 22808981849161443} + - component: {fileID: 22808981849161440} + - component: {fileID: 22808981849161441} + - component: {fileID: 22808981849161442} + m_Layer: 0 + m_Name: Cube (3) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &22808981849161443 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 22808981849161444} + m_LocalRotation: {x: -0, y: -0.38268343, z: -0, w: 0.92387956} + m_LocalPosition: {x: 0.035, y: 0, z: 0} + m_LocalScale: {x: 0.10000001, y: 0.01, z: 0.20000002} + m_Children: [] + m_Father: {fileID: 22808981331449236} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: -45, z: 0} +--- !u!33 &22808981849161440 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 22808981849161444} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &22808981849161441 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 22808981849161444} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 3c55769e893c4f4c8c51b7fa69bee2b9, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + 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!65 &22808981849161442 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 22808981849161444} + 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} diff --git a/Assets/prefabs/Indicator.prefab.meta b/Assets/prefabs/Indicator.prefab.meta new file mode 100644 index 0000000..1a6d081 --- /dev/null +++ b/Assets/prefabs/Indicator.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c034a8317bbf330459125adbd43f368b +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/scripts/IndicatorManager.cs b/Assets/scripts/IndicatorManager.cs new file mode 100644 index 0000000..09ce2b1 --- /dev/null +++ b/Assets/scripts/IndicatorManager.cs @@ -0,0 +1,76 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class IndicatorManager : MonoBehaviour +{ + [SerializeField] + private GameObject targetObject = default; + [SerializeField] + private GameObject indicatorObject = default; + [SerializeField] + private float forwardOffset = 1.5f; + [SerializeField] + private float heightOffset = -0.1f; + private bool showIndicator = false; + + private void Start() + { + showIndicator = indicatorObject.activeInHierarchy; + } + + void Update() + { + if (showIndicator) + { + DirectionUpdate(); + } + } + + public void ToggleIndicator() + { + showIndicator = !showIndicator; + if (showIndicator) + { + Debug.Log("Indicator ON"); + } + else + { + Debug.Log("Indicator OFF"); + } + SetIndicator(); + } + + private void SetIndicator() + { + if (targetObject == null) + { + showIndicator = false; + } + + indicatorObject.SetActive(showIndicator); + } + + private void DirectionUpdate() + { + if (targetObject == null) + { + return; + } + + Vector3 indicatorPosition; + Vector3 indicatorDirection; + Quaternion indicatorRotation; + + indicatorPosition = Camera.main.gameObject.transform.position + Vector3.Scale(Camera.main.gameObject.transform.forward, new Vector3(1,0,1) * forwardOffset); + indicatorPosition.y += heightOffset; + + indicatorDirection = (targetObject.transform.position - Camera.main.gameObject.transform.position).normalized; + indicatorDirection.y = 0; + + indicatorRotation = Quaternion.LookRotation(indicatorDirection, Vector3.up); + + indicatorObject.transform.position = indicatorPosition; + indicatorObject.transform.rotation = Quaternion.Lerp(indicatorObject.transform.rotation, indicatorRotation, 0.05f); + } +} diff --git a/Assets/scripts/IndicatorManager.cs.meta b/Assets/scripts/IndicatorManager.cs.meta new file mode 100644 index 0000000..908186d --- /dev/null +++ b/Assets/scripts/IndicatorManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 58a1a5b5eb3404a4f9870eed7e785e21 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/scripts/TargetMoveManager.cs b/Assets/scripts/TargetMoveManager.cs new file mode 100644 index 0000000..6975d3c --- /dev/null +++ b/Assets/scripts/TargetMoveManager.cs @@ -0,0 +1,40 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using Microsoft.MixedReality.Toolkit.Input; + +public class TargetMoveManager : MonoBehaviour +{ + public float timeOut; + + private int i = 0; + + private Vector3[] targetPosition = { + new Vector3(2f, 0f, 2f), + new Vector3(-2f, 0f, -2f), + new Vector3(-2f, 0f, 2f), + new Vector3(2f, 0f, -2f), + }; + + + void Start() { + StartCoroutine( FuncCoroutine() ); + } + + IEnumerator FuncCoroutine() { + while(true){ + TargetPositionUpdate(); + yield return new WaitForSeconds(timeOut); + } + } + + public void TargetPositionUpdate() + { + if (i >= targetPosition.Length) + { + i = 0; + } + this.gameObject.transform.position = targetPosition[i]; + i++; + } +} diff --git a/Assets/scripts/TargetMoveManager.cs.meta b/Assets/scripts/TargetMoveManager.cs.meta new file mode 100644 index 0000000..992c19c --- /dev/null +++ b/Assets/scripts/TargetMoveManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1d2f257f0e7ab46459c29ebf7883f9f9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 490da3d..858f759 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -125,7 +125,9 @@ PlayerSettings: 16:9: 1 Others: 1 bundleVersion: 0.1 - preloadedAssets: [] + preloadedAssets: + - {fileID: 25098592600295253, guid: 463af381c7d3f9f4aa4d36d4741af32c, type: 2} + - {fileID: -510805097034126955, guid: 73be8565ced89ca49b8a2e164ce488b9, type: 2} metroInputSource: 0 wsaTransparentSwapchain: 0 m_HolographicPauseOnTrackingLoss: 1