diff --git a/Assets/AR-Object-Control-Tool/Prefabs/AR-Object-Control-Tool.prefab b/Assets/AR-Object-Control-Tool/Prefabs/AR-Object-Control-Tool.prefab index f30a7ad..9f765b7 100644 --- a/Assets/AR-Object-Control-Tool/Prefabs/AR-Object-Control-Tool.prefab +++ b/Assets/AR-Object-Control-Tool/Prefabs/AR-Object-Control-Tool.prefab @@ -1,6 +1,6 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: ---- !u!1 &5224687268042533473 +--- !u!1 &859491231 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -8,9 +8,9 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 5224687268042533478} - - component: {fileID: 5224687268042533476} - - component: {fileID: 5224687268042533479} + - component: {fileID: 859491232} + - component: {fileID: 859491234} + - component: {fileID: 859491233} m_Layer: 5 m_Name: Text m_TagString: Untagged @@ -18,19 +18,19 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!224 &5224687268042533478 +--- !u!224 &859491232 RectTransform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 5224687268042533473} + m_GameObject: {fileID: 859491231} 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_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 5224687268482618266} + m_Father: {fileID: 1443854340} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} @@ -38,21 +38,21 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &5224687268042533476 +--- !u!222 &859491234 CanvasRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 5224687268042533473} + m_GameObject: {fileID: 859491231} m_CullTransparentMesh: 1 ---- !u!114 &5224687268042533479 +--- !u!114 &859491233 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 5224687268042533473} + m_GameObject: {fileID: 859491231} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} @@ -66,7 +66,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: Stop + m_text: Reset scale m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} @@ -135,7 +135,7 @@ MonoBehaviour: m_hasFontAssetChanged: 0 m_baseMaterial: {fileID: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0} ---- !u!1 &5224687268089264963 +--- !u!1 &1379880049 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -143,32 +143,170 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 5224687268089264960} - m_Layer: 0 - m_Name: AR-Object-Control-Tool + - component: {fileID: 1379880050} + m_Layer: 5 + m_Name: ScaleFactorIndicator m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &5224687268089264960 -Transform: +--- !u!224 &1379880050 +RectTransform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 5224687268089264963} + m_GameObject: {fileID: 1379880049} 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_ConstrainProportionsScale: 0 m_Children: - - {fileID: 5224687269002271417} - - {fileID: 5224687268721027060} - m_Father: {fileID: 0} + - {fileID: 1443854340} + m_Father: {fileID: 5224687268406203353} + 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: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &1443854339 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1443854340} + - component: {fileID: 1443854343} + - component: {fileID: 1443854342} + - component: {fileID: 1443854341} + m_Layer: 5 + m_Name: ResetScaleButton + m_TagString: UI + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1443854340 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1443854339} + 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_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 859491232} + m_Father: {fileID: 1379880050} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &5224687268114199293 + m_AnchorMin: {x: 0.5, y: 0} + m_AnchorMax: {x: 0.5, y: 0} + m_AnchoredPosition: {x: 0, y: 250} + m_SizeDelta: {x: 500, y: 150} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &1443854343 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1443854339} + m_CullTransparentMesh: 1 +--- !u!114 &1443854342 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1443854339} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &1443854341 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1443854339} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + 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.8490566, g: 0.8282307, b: 0.8282307, 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_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, 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_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 1443854342} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 5224687268821800706} + m_TargetAssemblyTypeName: MovementManager, Assembly-CSharp + m_MethodName: ResetScale + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!1 &5224687268042533473 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -176,51 +314,51 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 5224687268114199282} - - component: {fileID: 5224687268114199280} - - component: {fileID: 5224687268114199283} + - component: {fileID: 5224687268042533478} + - component: {fileID: 5224687268042533476} + - component: {fileID: 5224687268042533479} m_Layer: 5 - m_Name: ScaleFactorIndicator + m_Name: Text m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!224 &5224687268114199282 +--- !u!224 &5224687268042533478 RectTransform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 5224687268114199293} + m_GameObject: {fileID: 5224687268042533473} 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_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 5224687268406203353} - m_RootOrder: 1 + m_Father: {fileID: 5224687268482618266} + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0} - m_AnchorMax: {x: 0.5, y: 0} - m_AnchoredPosition: {x: 0, y: 250} - m_SizeDelta: {x: 500, y: 300} + 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!222 &5224687268114199280 +--- !u!222 &5224687268042533476 CanvasRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 5224687268114199293} + m_GameObject: {fileID: 5224687268042533473} m_CullTransparentMesh: 1 ---- !u!114 &5224687268114199283 +--- !u!114 &5224687268042533479 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 5224687268114199293} + m_GameObject: {fileID: 5224687268042533473} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} @@ -234,7 +372,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: x1 + m_text: Stop m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} @@ -243,8 +381,8 @@ MonoBehaviour: m_fontMaterials: [] m_fontColor32: serializedVersion: 2 - rgba: 4292583460 - m_fontColor: {r: 0.140922, g: 0.627725, b: 0.8584906, a: 1} + rgba: 4278190080 + m_fontColor: {r: 0, g: 0, b: 0, a: 1} m_enableVertexGradient: 0 m_colorMode: 3 m_fontColorGradient: @@ -261,12 +399,12 @@ MonoBehaviour: m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_fontSize: 100 - m_fontSizeBase: 36 + m_fontSize: 72 + m_fontSizeBase: 24 m_fontWeight: 400 m_enableAutoSizing: 1 m_fontSizeMin: 18 - m_fontSizeMax: 100 + m_fontSizeMax: 72 m_fontStyle: 1 m_HorizontalAlignment: 2 m_VerticalAlignment: 512 @@ -303,6 +441,39 @@ MonoBehaviour: m_hasFontAssetChanged: 0 m_baseMaterial: {fileID: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!1 &5224687268089264963 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5224687268089264960} + m_Layer: 0 + m_Name: AR-Object-Control-Tool + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5224687268089264960 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5224687268089264963} + 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_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 5224687269002271417} + - {fileID: 5224687268721027060} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &5224687268384646760 GameObject: m_ObjectHideFlags: 0 @@ -408,7 +579,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: - {fileID: 5224687268384646761} - - {fileID: 5224687268114199282} + - {fileID: 1379880050} m_Father: {fileID: 5224687268905844787} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -632,8 +803,10 @@ MonoBehaviour: Rotating: 1 Replacement: 1 Movement: 1 - ObjectContainer: {fileID: 0} - ObjectToAffect: {fileID: 0} + objectContainer: {fileID: 0} + objectToAffect: {fileID: 0} + targetCamera: {fileID: 0} + targetUICamera: {fileID: 0} useExternalScript: 1 useElevetionManager: 1 fullAR: 0 @@ -643,10 +816,10 @@ MonoBehaviour: minObjectScale: 1 useScaleIndicator: 1 showRawScale: 0 - scaleText: {fileID: 5224687268114199283} + scaleIndicatorCanvas: {fileID: 0} + scaleText: {fileID: 0} baseScale: 1 - currentScale: 0 - scaleFactor: 0 + resetScaleButton: {fileID: 0} rotationAxis: 0 rotationSpeed: 0.07 loadingObject: {fileID: 5224687268384646760} @@ -667,8 +840,8 @@ MonoBehaviour: m_EditorClassIdentifier: isItLevitate: 0 groundPosition: 0.55 + objectContainer: {fileID: 0} objectToAffect: {fileID: 0} - parentObject: {fileID: 0} objectAnimator: {fileID: 0} playAnimation: 1 objectFloatHeight: 1 diff --git a/Assets/AR-Object-Control-Tool/Prefabs/ScaleFactorIndicator.prefab b/Assets/AR-Object-Control-Tool/Prefabs/ScaleFactorIndicator.prefab new file mode 100644 index 0000000..a0b8b2f --- /dev/null +++ b/Assets/AR-Object-Control-Tool/Prefabs/ScaleFactorIndicator.prefab @@ -0,0 +1,305 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &4991700540502920160 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4991700540502920161} + - component: {fileID: 4991700540502920163} + - component: {fileID: 4991700540502920162} + m_Layer: 3 + m_Name: ValueText + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &4991700540502920161 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4991700540502920160} + m_LocalRotation: {x: 0, y: -0.7071068, z: 0.7071068, w: 0} + m_LocalPosition: {x: 0, y: 0, z: 0.004} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4991700540966865764} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 180} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0.001, y: 0.15} + m_SizeDelta: {x: 9.212, y: 3.874} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!23 &4991700540502920163 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4991700540502920160} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, 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 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!114 &4991700540502920162 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4991700540502920160} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9541d86e2fd84c1d9990edf0852d74ab, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: x1 + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4278190080 + m_fontColor: {r: 0, g: 0, b: 0, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 34.65 + m_fontSizeBase: 36 + m_fontWeight: 400 + m_enableAutoSizing: 1 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 1 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 0 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: -0.0022373188, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + _SortingLayer: 0 + _SortingLayerID: 0 + _SortingOrder: 0 + m_hasFontAssetChanged: 0 + m_renderer: {fileID: 4991700540502920163} + m_maskType: 0 +--- !u!1 &4991700540966865763 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4991700540966865764} + - component: {fileID: 4991700540966865767} + - component: {fileID: 4991700540966865766} + - component: {fileID: 4991700540966865765} + m_Layer: 3 + m_Name: Background + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4991700540966865764 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4991700540966865763} + m_LocalRotation: {x: 0, y: -0.7071068, z: 0.7071068, w: 0} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.05, y: 0.05, z: 0.05} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4991700540502920161} + m_Father: {fileID: 4991700541301549224} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 180} +--- !u!33 &4991700540966865767 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4991700540966865763} + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &4991700540966865766 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4991700540966865763} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 89a5a7cd043e3aa43b48a5d0baacc31a, 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 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!64 &4991700540966865765 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4991700540966865763} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 4 + m_Convex: 0 + m_CookingOptions: 30 + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &4991700541301549239 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4991700541301549224} + m_Layer: 3 + m_Name: ScaleFactorIndicator + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4991700541301549224 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4991700541301549239} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.7, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4991700540966865764} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Assets/AR-Object-Control-Tool/Prefabs/ScaleFactorIndicator.prefab.meta b/Assets/AR-Object-Control-Tool/Prefabs/ScaleFactorIndicator.prefab.meta new file mode 100644 index 0000000..3dc63e4 --- /dev/null +++ b/Assets/AR-Object-Control-Tool/Prefabs/ScaleFactorIndicator.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a45a6043c8f46274cad469b701bb33b6 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AR-Object-Control-Tool/Prefabs/UICamera.prefab b/Assets/AR-Object-Control-Tool/Prefabs/UICamera.prefab new file mode 100644 index 0000000..5d5e869 --- /dev/null +++ b/Assets/AR-Object-Control-Tool/Prefabs/UICamera.prefab @@ -0,0 +1,77 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &6848335622158894120 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6848335622158894121} + - component: {fileID: 6848335622158894123} + m_Layer: 3 + m_Name: UICamera + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6848335622158894121 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6848335622158894120} + 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_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!20 &6848335622158894123 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6848335622158894120} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 3 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: 10 + m_CullingMask: + serializedVersion: 2 + m_Bits: 8 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 diff --git a/Assets/AR-Object-Control-Tool/Prefabs/UICamera.prefab.meta b/Assets/AR-Object-Control-Tool/Prefabs/UICamera.prefab.meta new file mode 100644 index 0000000..fec6a40 --- /dev/null +++ b/Assets/AR-Object-Control-Tool/Prefabs/UICamera.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: bd9bd9bfd973251468f3c764458dfcf0 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AR-Object-Control-Tool/README.md b/Assets/AR-Object-Control-Tool/README.md index 55fabb5..e9577d2 100644 --- a/Assets/AR-Object-Control-Tool/README.md +++ b/Assets/AR-Object-Control-Tool/README.md @@ -1,6 +1,6 @@ # AR-Object-Control-Tool -The **_AR-Object-Control-Tool_** for **_Unity3D_** allows you to easily control your objects in your Unity3D projects. Just add the necessary scripts to your code, configure them following the documentation below and you will be able to **_move_**, **_rotate_** and **_rescale_** of your objects in real time. This tool is easy to use and **_modulable_**, supports **_touch devices_** and **_augmented reality_**. +The ***AR-Object-Control-Tool*** for ***Unity3D*** allows you to easily control your objects in your Unity3D projects. Just add the necessary scripts to your code, configure them following the documentation below and you will be able to ***move***, ***rotate*** and ***rescale*** of your objects in real time. This tool is easy to use and ***modulable***, supports ***touch devices*** and ***augmented reality***. ## Contents: @@ -11,7 +11,7 @@ The **_AR-Object-Control-Tool_** for **_Unity3D_** allows you to easily control ## Tool Overview: -The **_AR-Object-Control-Tool_** is divided into two main parts. The first part is the **`MovementManager.cs`** script which is the basis of the tool and allows you to use the main functions such as : +The ***AR-Object-Control-Tool*** is divided into two main parts. The first part is the **`MovementManager.cs`** script which is the basis of the tool and allows you to use the main functions such as : - **Move** the object by touching it and moving it on the screen. - **Rotate** the object by using one or more fingers to rotate the screen. @@ -20,38 +20,37 @@ The **_AR-Object-Control-Tool_** is divided into two main parts. The first part The second part of the tool, located in the **`ElevationManager.cs`** script, is a **complementary module** to the first script. It can **also be used independently** if you do not want to manipulate your object. This part of the tool will allow you to **float an object** and play an animation on it. -It is important to note that for now, the module only supports **_touch inputs_**. This tool requires a version of Unity higher or equal to [`Unity 2021.X`](https://unity.com/releases/editor/archive). +It is important to note that for now, the module only supports ***touch inputs***. This tool requires a version of Unity higher or equal to [`Unity 2021.X`](https://unity.com/releases/editor/archive). ## The different modules: -### **_MovementManager_**: +### ***MovementManager***: -The object manipulation module allows to manipulate any GameObject that has been defined as a target. To define a GameObject as a target, you just have to add the tag _`ObjectToAffect`_. Once your object is defined as a target, you can use the following functions: +The object manipulation module allows to manipulate any GameObject that has been defined as a target. To define a GameObject as a target, you just have to add the tag *`ObjectToAffect`*. Once your object is defined as a target, you can use the following functions: - ### Move your object: - This function allows you to move an object that has been set as a target. Simply place your finger on the object and move it where you want. + This function allows you to move an object that has been set as a target. Simply place your finger on the object and move it where you want. - ### Rotate your object: - This function allows your target object to rotate (locally) based on the movement of your Input_0 (Input.GetTouch(0) which is the first finger to touch the screen). - There are two parameters available for this function: - - 1. The axis of rotation: - - `All` - - `X` - - `Y` - 2. The speed of rotation. + This function allows your target object to rotate (locally) based on the movement of your Input_0 (Input.GetTouch(0) which is the first finger to touch the screen). + There are two parameters available for this function: + 1. The axis of rotation: + - `All` + - `X` + - `Y` + 3. The speed of rotation. - ### Change the size of your object: - This function allows you to change the size of the object that has been set as the target. To do this, use two fingers and make a pinching motion on the screen to reduce the size of your object, and make the opposite motion to increase its size. You can set a minimum and maximum size by changing the `maxObjectScale` and `minObjectScale` parameters in the _`Scale`_ category of the _`Selected options settings`_ block. + This function allows you to change the size of the object that has been set as the target. To do this, use two fingers and make a pinching motion on the screen to reduce the size of your object, and make the opposite motion to increase its size. You can set a minimum and maximum size by changing the `maxObjectScale` and `minObjectScale` parameters in the *`Scale`* category of the *`Selected options settings`* block. - ### Reposition your object: - The tool supports augmented reality and allows you to reposition an object using the placement function of your AR solution by adding a line of code in the `MovementManager.cs` script. - -### **_ElevationManager_** : + The tool supports augmented reality and allows you to reposition an object using the placement function of your AR solution by adding a line of code in the `MovementManager.cs` script. + +### ***ElevationManager*** : The object floatation module allows you to lift an object to a target position and then play an animation. The animation is by default an animation allowing the object to float but, it can be changed later for a more advanced use of the tool. @@ -61,19 +60,17 @@ Download the tool via this [**UnityPackage**](https://github.com/LeoSery/AR-Obje Once downloaded, open unity and drag it into your `project` window. Once the import window is open, select the scripts you want to import between `MovementManager.cs` and `ElevationManager.cs`. For each of the two scripts make sure that its Editor script (`...CustomEditor`) is also selected and click `import`. -In the demo project you can find the scripts in : - +In the demo project you can find the scripts in : ``` ../Assets/AR-Object-Control-Tool/Scripts -``` +``` In the UnityPackage you can find the scripts in : - ``` ../AR-Object-Control-Tool/Scripts -``` +``` -To use the tool you can use the prefab `AR-Object-Control-Tool` which is located in `../Assets/Prefabs` and drag and drop it into your scene. Then you only have to set up the tool following the documentation below. +To use the tool you can use the prefab `AR-Object-Control-Tool` which is located in `../Assets/Prefabs` and drag and drop it into your scene. Then you only have to set up the tool following the documentation below. Or you can choose to use the scripts independently by choosing where you want to place them. To do this drag and drop the script of your choice on an object of your scene so that it is active. It is recommended to add it on the object you want to set as target because if you don't reference any object in the `ObjectToAffect` field, by default the script will take the object it is present on. @@ -81,133 +78,152 @@ You can put both the `MovementManager` and `ElevationManager` components on the ## How to configure the tool for your project: -### **_MovementManager_** : +### ***MovementManager*** : By default when the component is added on an object you have 4 categories: - **Allowed Options** - This category will define with which type of manipulation your object will be able to be manipulated. There are 4 types of manipulation possible: + This category will define with which type of manipulation your object will be able to be manipulated. There are 4 types of manipulation possible: - 1. _Scaling_ - 2. _Rotating_ - 3. _Replacement_ - 4. _Movement_ + 1. *Scaling* + 2. *Rotating* + 3. *Replacement* + 4. *Movement* - Each of these options has a checkbox to enable / disable the functionality. They can be used independently or simultaneously. + Each of these options has a checkbox to enable / disable the functionality. They can be used independently or simultaneously. - **General Settings** - Will allow you to manage the use of external scripts such as the `ElevationManager` that comes with the tool or for more advanced use, another script can be configured to interact with this script. + Will allow you to manage the use of external scripts such as the `ElevationManager` that comes with the tool or for more advanced use, another script can be configured to interact with this script. - **Script Target** - Main category of the component that will allow to define which object will be the target of the manipulation done by the script. To define an object as a target you need to reference this object in the `Object To Affect` field and give it the tag: `ObjectToAffect`. - It is recommended to place the target object as a child of an empty and to reference the empty in the `Object Container` field. This may avoid some problems with position calculations or animation problems if you use the `ElevationManager` component. - + Main category of the component that will allow to define which object will be the target of the manipulation done by the script. To define an object as a target you need to reference this object in the `Object To Affect` field and give it the tag: `ObjectToAffect`. + It is recommended to place the target object as a child of an empty and to reference the empty in the `Object Container` field. This may avoid some problems with position calculations or animation problems if you use the `ElevationManager` component. + - **UI** - By default the tool does not take into account the UI display and will calculate the movement of your finger even if you are on a button or an image displayed by your canvas. By checking the `Throught UI` option you can define a tag for which the script should stop manipulating the target object when your finger is currently on a UI with that tag. - + By default the tool does not take into account the UI display and will calculate the movement of your finger even if you are on a button or an image displayed by your canvas. By checking the `Throught UI` option you can define a tag for which the script should stop manipulating the target object when your finger is currently on a UI with that tag. + By enabling some of the options listed above, other options may appear in the component, you will see how to configure them in the rest of this documentation. By checking one or more `Allowed Options` a new large category called `Selected Options Settings` appears and gives you access to new configuration options such as : - **Scale** - This category appears when you check the _`Scaling`_ field. - By unfolding this menu you have 2 new fields: - - `Min Object Scale` > will allow you to define the minimum size to which the object can shrink. - - `Max Object Scale` > will allow you to define the maximum size to which the object can grow. - - `Use Scale Indicator` > will let you know the size factor of the target object in relation to its original size. And if you check this option 3 new parameters will appear: - - - `Scale Text` > is the target text on which the current scale factor will be displayed. - - `Base Scale` > is the reference value for the calculation of the scale of the target object. It corresponds to the size of the object when it is scaled 1:1. - - `Show Raw Scale` > by default the negative values are displayed with logarithmic steps but by checking this option you can display the raw values and thus have all the different scale values. - - The scale indicator uses a text object from the Unity package named `TextMeshPro`, if it is not already installed in your project you can see how to install it [here](https://learn.unity.com/tutorial/working-with-textmesh-pro). - + This category appears when you check the *`Scaling`* field. + By unfolding this menu you have 2 new fields: + + `Min Object Scale` > will allow you to define the minimum size to which the object can shrink. + + `Max Object Scale` > will allow you to define the maximum size to which the object can grow. + + `Use Scale Indicator` > will let you know the size factor of the target object in relation to its original size. And if you check this option 3 new parameters will appear: + - `Scale Indicator Image Prefab` > This field allows you to set a canvas that will be the receptacle for the UI that displays the scale factor of the object. The target canvas must be configured correctly to be used with the *Use Scale Indicator* option. See below for steps on how to properly configure the target canvas. + - `target UI Camera Prefab` > So that the scale indicator is always visible the tool uses a second camera which is responsible for rendering the indicator, you must reference it here. More information about the UI Camera below. + - `Scale Text` > is the target text on which the current scale factor will be displayed. + - `Base Scale` > is the reference value for the calculation of the scale of the target object. It corresponds to the size of the object when it is scaled 1:1. + - `Show Raw Scale` > by default the negative values are displayed with logarithmic steps but by checking this option you can display the raw values and thus have all the different scale values. + + **Setting up the UI for the Scale Indicator :** + + It is recommended to use the `ScaleFactorCanvas` and the `UICamera` included in the [UnityPackage](https://github.com/LeoSery/AR-Object-Control-Tool--Unity3DTool/releases) prefab to use the `Scale Indicator Canvas` option. + + But you can use your own by configuring it with the following steps: + + Before setting up your UI, once your object and the `MovementManager` script are present in your scene make sure that the fields listed in the `General Settings` and `Script Target` categories are filled in. Then, follow these steps : + ``` + 1. Add a canvas to your scene, set its `Render Mode` to `World Space` and then place it where you want it on your target object. + 2. Drag your Canvas into the `Scale Indicator Canvas` field of the tool. + 3. Enter the target text of your UI canvas in the `Scale Text` field of the tool. + 4. Add a new Camera to your scene. Set its `Clear Flags` parameter to `Depth Only` and then `Depth` to 10. + 5. Remove the audio listener from the camera you just added. + 6. Add a Layer to your Canvas. Then in the `Culling Mask` field of your main camera uncheck this same layer so that the category changes to `Mixed`. + 7. Conversely, in the UI camera, in the `Culling Mask` field uncheck all layers except the one you just added. + 8. Enter the new UI camera in the `Target UI Camera` field of the tool. + ``` +--- +The scale indicator uses a text object from the Unity package named `TextMeshPro`, if it is not already installed in your project you can see how to install it [here](https://learn.unity.com/tutorial/working-with-textmesh-pro). + - **Rotation** - This category appears when you check the _`Rotating`_ field. - In this foldout menu you can manage on which axis you want your target to rotate. Among the 3 following possibilities: - - `X` > the object will rotate on the horizontal axis, which corresponds to the **X** axis in Unity. - - `Y` > the object will rotate on the vertical axis, which corresponds to the **Y** axis in Unity. - - `All` > the object will rotate on all its axes (**X**,**Y**,**Z**) at the same time. - + This category appears when you check the *`Rotating`* field. + In this foldout menu you can manage on which axis you want your target to rotate. Among the 3 following possibilities: + + `X` > the object will rotate on the horizontal axis, which corresponds to the **X** axis in Unity. + + `Y` > the object will rotate on the vertical axis, which corresponds to the **Y** axis in Unity. + + `All` > the object will rotate on all its axes (**X**,**Y**,**Z**) at the same time. + - **Move** - This category appears when you check the _`Replacement`_ field. - In this part you will be able to reference an image in the `Loading Object` field, it will be used to display the progress bar for your target replacement. The image is displayed when your finger remains static on the screen for a certain period of time. - - In order to use the replacement function you must call the replacement function of your augmented reality solution. You must call this function in the `MovementManager.cs` script, region `Methods.Replace();`. - - It looks like this: - - ```csharp - public class MovementManager : MonoBehaviour - { - ... - - #region Methods.Replace(); - public void Replace() - { - //call your AR replacement function here - } - #endregion - } - ``` - + This category appears when you check the *`Replacement`* field. + In this part you will be able to reference an image in the `Loading Object` field, it will be used to display the progress bar for your target replacement. The image is displayed when your finger remains static on the screen for a certain period of time. + + In order to use the replacement function you must call the replacement function of your augmented reality solution. You must call this function in the `MovementManager.cs` script, region `Methods.Replace();`. + + It looks like this: + ```csharp + public class MovementManager : MonoBehaviour + { + ... + + #region Methods.Replace(); + public void Replace() + { + //call your AR replacement function here + } + #endregion + } + ``` + - **Additional Scripts** - This category appears when you check the _`Use External Script`_ field located in the `General Settings` category. It will allow you to reference scripts so that they can interact with the `MovementManager`. - - Basically the tool is configured to receive an `ElevationManager`. If you fill in the script, by default you can only manipulate the object once it is floating, i.e. when the `isItLevitate` variable of the `ElevationManager` is set. - -### **_ElevationManager_** : + This category appears when you check the *`Use External Script`* field located in the `General Settings` category. It will allow you to reference scripts so that they can interact with the `MovementManager`. + + Basically the tool is configured to receive an `ElevationManager`. If you fill in the script, by default you can only manipulate the object once it is floating, i.e. when the `isItLevitate` variable of the `ElevationManager` is set. + +### ***ElevationManager*** : At the top of this component you will find a field indicating the current state of the object, to indicate if it is currently floating or not. - **General Settings** - As with the `MovementManager` you will find a list of options that can be activated, which when at least one of them is activated, brings up a new category called `Selected Options Settings`. + As with the `MovementManager` you will find a list of options that can be activated, which when at least one of them is activated, brings up a new category called `Selected Options Settings`. + + List of options you can enable/disable: - List of options you can enable/disable: + 1. *Play Animation* + 2. *Use External Script* + 3. *Use Vuforia* - 1. _Play Animation_ - 2. _Use External Script_ - 3. _Use Vuforia_ - **GameObjects** - As for the `MovementManager` this category is the main one of the component, it allows to define which object will be the target of the manipulation made by the script. To define an object as a target you have to reference this object in the `Object To Affect` field and assign it the tag: `ObjectToAffect`. - It is recommended to place the target object as a child of an empty and to reference the empty in the `Object Container` field. This may prevent some animation problems when the object is levitated. + As for the `MovementManager` this category is the main one of the component, it allows to define which object will be the target of the manipulation made by the script. To define an object as a target you have to reference this object in the `Object To Affect` field and assign it the tag: `ObjectToAffect`. + It is recommended to place the target object as a child of an empty and to reference the empty in the `Object Container` field. This may prevent some animation problems when the object is levitated. - **UI** - To trigger the levitation, just touch the object that has been defined as the target and it will automatically move to the target position that you have defined through the `Object Float Height` field located in the `Animation` category once you have checked the `Play Animation` option above. - As far as stopping the levitation is concerned, at the moment the tool does not support a second press on the target object, you need to reference a button that should call the function `ElevationManager.StopLevitate()`. - + To trigger the levitation, just touch the object that has been defined as the target and it will automatically move to the target position that you have defined through the `Object Float Height` field located in the `Animation` category once you have checked the `Play Animation` option above. + As far as stopping the levitation is concerned, at the moment the tool does not support a second press on the target object, you need to reference a button that should call the function `ElevationManager.StopLevitate()`. + By checking one or more of the options located in `General Settings` a new large category named `Selected Options Settings` appears and gives you access to new configuration options such as : - **Play Animation** - By activating this option, you will see an `Animation` category that contains two fields: - - Object Float Height > which allows you to set the height at which the target object should rise when you click on it. + By activating this option, you will see an `Animation` category that contains two fields: - Speed` > which allows you to set the speed at which the target object should reach the height you set. + `Object Float Height` > which allows you to set the height at which the target object should rise when you click on it. + + `Speed` > which allows you to set the speed at which the target object should reach the height you set. - **Use External Script** - This category allows you to reference an external script such as the `MovementManager` to apply conditions and for example make the external script function only available when the `isItLevitate` variable is set to `True`. By default you can reference a `MovementManager`. But you can modify the script and add your own scritp for a more advanced use of the tool. - + This category allows you to reference an external script such as the `MovementManager` to apply conditions and for example make the external script function only available when the `isItLevitate` variable is set to `True`. By default you can reference a `MovementManager`. But you can modify the script and add your own scritp for a more advanced use of the tool. + - **Use Vuforia** - Just like the other module, this one supports augmented reality. Basically it is configured to be used with the "Vuforia" solution, so you can enable this option to have the return height of the target object defined by vuforia by enabling the `Object Defines Height` option and filling in the `Height Reference Object` field. + Just like the other module, this one supports augmented reality. Basically it is configured to be used with the "Vuforia" solution, so you can enable this option to have the return height of the target object defined by vuforia by enabling the `Object Defines Height` option and filling in the `Height Reference Object` field. diff --git a/Assets/AR-Object-Control-Tool/Resources/Graphics/Indicator.meta b/Assets/AR-Object-Control-Tool/Resources/Graphics/Indicator.meta new file mode 100644 index 0000000..8f3e97d --- /dev/null +++ b/Assets/AR-Object-Control-Tool/Resources/Graphics/Indicator.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4c4df7e79f13e1d4590bac3c4ddf92d6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AR-Object-Control-Tool/Resources/Graphics/Indicator/BackgroundMaterial.mat b/Assets/AR-Object-Control-Tool/Resources/Graphics/Indicator/BackgroundMaterial.mat new file mode 100644 index 0000000..9e6b47a --- /dev/null +++ b/Assets/AR-Object-Control-Tool/Resources/Graphics/Indicator/BackgroundMaterial.mat @@ -0,0 +1,80 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: BackgroundMaterial + m_Shader: {fileID: 10751, guid: 0000000000000000f000000000000000, type: 0} + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 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: 2800000, guid: 9e4117bbf0b79c74586db6fa62413cf2, type: 3} + 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_Ints: [] + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + m_BuildTextureStacks: [] diff --git a/Assets/AR-Object-Control-Tool/Resources/Graphics/Indicator/BackgroundMaterial.mat.meta b/Assets/AR-Object-Control-Tool/Resources/Graphics/Indicator/BackgroundMaterial.mat.meta new file mode 100644 index 0000000..1534c5d --- /dev/null +++ b/Assets/AR-Object-Control-Tool/Resources/Graphics/Indicator/BackgroundMaterial.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 89a5a7cd043e3aa43b48a5d0baacc31a +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AR-Object-Control-Tool/Resources/Graphics/backgroudScaleFactor.png b/Assets/AR-Object-Control-Tool/Resources/Graphics/backgroudScaleFactor.png new file mode 100644 index 0000000..7260563 Binary files /dev/null and b/Assets/AR-Object-Control-Tool/Resources/Graphics/backgroudScaleFactor.png differ diff --git a/Assets/AR-Object-Control-Tool/Resources/Graphics/backgroudScaleFactor.png.meta b/Assets/AR-Object-Control-Tool/Resources/Graphics/backgroudScaleFactor.png.meta new file mode 100644 index 0000000..56eac36 --- /dev/null +++ b/Assets/AR-Object-Control-Tool/Resources/Graphics/backgroudScaleFactor.png.meta @@ -0,0 +1,135 @@ +fileFormatVersion: 2 +guid: 9e4117bbf0b79c74586db6fa62413cf2 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/AR-Object-Control-Tool/Scripts/Editor/ElevationManagerCustomEditor.cs b/Assets/AR-Object-Control-Tool/Scripts/Editor/ElevationManagerCustomEditor.cs index f632a1e..3d1df7c 100644 --- a/Assets/AR-Object-Control-Tool/Scripts/Editor/ElevationManagerCustomEditor.cs +++ b/Assets/AR-Object-Control-Tool/Scripts/Editor/ElevationManagerCustomEditor.cs @@ -2,7 +2,7 @@ // AR-Object-Control-Tool -- ElevationManagerCustomEditor // Author: Léo Séry // Date created: 26/01/2023 -// Last updated: 26/01/2023 +// Last updated: 16/02/2023 // Purpose: Modifies the Unity3D GUI to display the Script ElevationManager component of the tool in a more organized way. // Documentation: https://github.com/LeoSery/AR-Object-Control-Tool--Unity3DTool ///////////////////////////////////////////////////////////////////////// @@ -19,7 +19,7 @@ public class ElevationManagerCustomEditor : Editor SerializedProperty groundPosition; SerializedProperty objectToAffect; - SerializedProperty parentObject; + SerializedProperty objectContainer; SerializedProperty objectAnimator; SerializedProperty playAnimation; @@ -52,7 +52,7 @@ private void OnEnable() groundPosition = serializedObject.FindProperty("groundPosition"); objectToAffect = serializedObject.FindProperty("objectToAffect"); - parentObject = serializedObject.FindProperty("parentObject"); + objectContainer = serializedObject.FindProperty("objectContainer"); objectAnimator = serializedObject.FindProperty("objectAnimator"); playAnimation = serializedObject.FindProperty("playAnimation"); @@ -99,8 +99,8 @@ public override void OnInspectorGUI() GameObjectSection = EditorGUILayout.Foldout(GameObjectSection, "GameObjects"); if (GameObjectSection) { + EditorGUILayout.PropertyField(objectContainer); EditorGUILayout.PropertyField(objectToAffect); - EditorGUILayout.PropertyField(parentObject); if (playAnimation.boolValue) EditorGUILayout.PropertyField(objectAnimator); } diff --git a/Assets/AR-Object-Control-Tool/Scripts/Editor/MovementManagerCustomEditor.cs b/Assets/AR-Object-Control-Tool/Scripts/Editor/MovementManagerCustomEditor.cs index b8f95dc..9dd2a70 100644 --- a/Assets/AR-Object-Control-Tool/Scripts/Editor/MovementManagerCustomEditor.cs +++ b/Assets/AR-Object-Control-Tool/Scripts/Editor/MovementManagerCustomEditor.cs @@ -2,7 +2,7 @@ // AR-Object-Control-Tool -- MovementManagerCustomEditor // Author: Léo Séry // Date created: 26/01/2023 -// Last updated: 15/02/2023 +// Last updated: 16/02/2023 // Purpose: Modifies the Unity3D GUI to display the MovementManager script component of the tool in a more organized way. // Documentation: https://github.com/LeoSery/AR-Object-Control-Tool--Unity3DTool ///////////////////////////////////////////////////////////////////////// @@ -22,8 +22,9 @@ public class MovementManagerCustomEditor : Editor SerializedProperty Replacement; SerializedProperty Movement; - SerializedProperty ObjectContainer; - SerializedProperty ObjectToAffect; + SerializedProperty objectContainer; + SerializedProperty objectToAffect; + SerializedProperty targetCamera; SerializedProperty useExternalScript; SerializedProperty useElevetionManager; SerializedProperty fullAR; @@ -35,10 +36,11 @@ public class MovementManagerCustomEditor : Editor SerializedProperty minObjectScale; SerializedProperty useScaleIndicator; SerializedProperty showRawScale; + SerializedProperty scaleIndicatorImagePrefab; + SerializedProperty targetUICameraPrefab; SerializedProperty scaleText; SerializedProperty baseScale; - SerializedProperty rotationAxis; SerializedProperty rotationSpeed; SerializedProperty loadingObject; @@ -65,8 +67,9 @@ private void OnEnable() Replacement = serializedObject.FindProperty("Replacement"); Movement = serializedObject.FindProperty("Movement"); - ObjectContainer = serializedObject.FindProperty("ObjectContainer"); - ObjectToAffect = serializedObject.FindProperty("ObjectToAffect"); + objectContainer = serializedObject.FindProperty("objectContainer"); + objectToAffect = serializedObject.FindProperty("objectToAffect"); + targetCamera = serializedObject.FindProperty("targetCamera"); useExternalScript = serializedObject.FindProperty("useExternalScript"); useElevetionManager = serializedObject.FindProperty("useElevetionManager"); fullAR = serializedObject.FindProperty("fullAR"); @@ -75,6 +78,8 @@ private void OnEnable() blockingIU = serializedObject.FindProperty("blockingIU"); useScaleIndicator = serializedObject.FindProperty("useScaleIndicator"); showRawScale = serializedObject.FindProperty("showRawScale"); + scaleIndicatorImagePrefab = serializedObject.FindProperty("scaleIndicatorImagePrefab"); + targetUICameraPrefab = serializedObject.FindProperty("targetUICameraPrefab"); scaleText = serializedObject.FindProperty("scaleText"); baseScale = serializedObject.FindProperty("baseScale"); @@ -109,6 +114,7 @@ public override void OnInspectorGUI() GeneralSettingsSection = EditorGUILayout.BeginFoldoutHeaderGroup(GeneralSettingsSection, "General Settings"); if (GeneralSettingsSection) { + EditorGUILayout.PropertyField(targetCamera); EditorGUILayout.PropertyField(useExternalScript); } EditorGUILayout.EndFoldoutHeaderGroup(); @@ -116,8 +122,8 @@ public override void OnInspectorGUI() ScriptTargetSection = EditorGUILayout.BeginFoldoutHeaderGroup(ScriptTargetSection, "Script Target"); if (ScriptTargetSection) { - EditorGUILayout.PropertyField(ObjectContainer); - EditorGUILayout.PropertyField(ObjectToAffect); + EditorGUILayout.PropertyField(objectContainer); + EditorGUILayout.PropertyField(objectToAffect); } EditorGUILayout.EndFoldoutHeaderGroup(); @@ -128,7 +134,9 @@ public override void OnInspectorGUI() EditorGUILayout.PropertyField(blockingIU); if (blockingIU.boolValue) { + EditorGUI.indentLevel++; EditorGUILayout.PropertyField(targetTag); + EditorGUI.indentLevel--; if (targetTag.stringValue == "") { targetTag.stringValue = "UI"; @@ -159,9 +167,13 @@ public override void OnInspectorGUI() EditorGUILayout.PropertyField(useScaleIndicator); if (useScaleIndicator.boolValue) { + EditorGUI.indentLevel++; + EditorGUILayout.PropertyField(scaleIndicatorImagePrefab); + EditorGUILayout.PropertyField(targetUICameraPrefab); EditorGUILayout.PropertyField(scaleText); EditorGUILayout.PropertyField(baseScale); EditorGUILayout.PropertyField(showRawScale); + EditorGUI.indentLevel--; } } EditorGUILayout.EndFoldoutHeaderGroup(); @@ -197,8 +209,10 @@ public override void OnInspectorGUI() if (AdditionalScriptsSection) { EditorGUILayout.PropertyField(useElevetionManager); + EditorGUI.indentLevel++; if (useElevetionManager.boolValue) EditorGUILayout.PropertyField(elevationManager); + EditorGUI.indentLevel--; } EditorGUILayout.EndFoldoutHeaderGroup(); } diff --git a/Assets/AR-Object-Control-Tool/Scripts/Tools/ElevationManager.cs b/Assets/AR-Object-Control-Tool/Scripts/Tools/ElevationManager.cs index 12efa95..24d9ada 100644 --- a/Assets/AR-Object-Control-Tool/Scripts/Tools/ElevationManager.cs +++ b/Assets/AR-Object-Control-Tool/Scripts/Tools/ElevationManager.cs @@ -2,7 +2,7 @@ // AR-Object-Control-Tool -- ElevationManager // Author: Léo Séry // Date created: 30/12/2022 -// Last updated: 30/12/2022 +// Last updated: 16/02/2023 // Purpose: Allow an object to levitate to a target point and play a floating animation. // Documentation: https://github.com/LeoSery/AR-Object-Control-Tool--Unity3DTool ///////////////////////////////////////////////////////////////////////// @@ -16,8 +16,8 @@ public class ElevationManager : MonoBehaviour public bool isItLevitate = false; public float groundPosition; + public GameObject objectContainer; public GameObject objectToAffect; - public GameObject parentObject; public Animator objectAnimator; public bool playAnimation; @@ -49,12 +49,12 @@ void Awake() void Start() { - Target = new Vector3(parentObject.transform.position.x, saveGroundPos, parentObject.transform.position.z); + Target = new Vector3(objectContainer.transform.position.x, saveGroundPos, objectContainer.transform.position.z); } void Update() { - if (parentObject != null) + if (objectContainer != null) if (Input.touchCount == 1 || Input.GetKeyDown(KeyCode.Mouse0)) if (IsOnObject()) if (!isItLevitate) @@ -74,7 +74,7 @@ public void SetUpManager() if (objectToAffect != null) { if (objectToAffect.transform.parent.gameObject != null) - parentObject = objectToAffect.transform.parent.gameObject; + objectContainer = objectToAffect.transform.parent.gameObject; else throw new System.NullReferenceException("ElevationManager > Place 'objectToAffect' in a parent to avoid coordinate problems during the animation."); @@ -99,7 +99,7 @@ public void SetUpManager() } else { - groundPosition = parentObject.transform.localPosition.y; + groundPosition = objectContainer.transform.localPosition.y; saveGroundPos = groundPosition; } @@ -114,9 +114,9 @@ public void SetUpManager() #region Methods.GoToTarget(); void GoToTarget() { - Vector3 travelDistance = Target - parentObject.transform.localPosition; + Vector3 travelDistance = Target - objectContainer.transform.localPosition; if (!movementManager.dragging) - parentObject.transform.localPosition = Vector3.SmoothDamp(parentObject.transform.localPosition, Target, ref Velocity, Speed * Time.deltaTime); + objectContainer.transform.localPosition = Vector3.SmoothDamp(objectContainer.transform.localPosition, Target, ref Velocity, Speed * Time.deltaTime); if (travelDistance.magnitude < 0.1f) { @@ -132,7 +132,7 @@ void GoToTarget() #region Methods.Levitate(); void Levitate() { - Target = new Vector3(parentObject.transform.localPosition.x, saveGroundPos, parentObject.transform.localPosition.z) + new Vector3(0f, objectFloatHeight, 0f); + Target = new Vector3(objectContainer.transform.localPosition.x, saveGroundPos, objectContainer.transform.localPosition.z) + new Vector3(0f, objectFloatHeight, 0f); stopButton.GetComponent