From e94173d643d60589de32d5597b6b8c2f1f8e140c Mon Sep 17 00:00:00 2001 From: "bocska.karina" <bocska.karina@hallgato.ppke.hu> Date: Tue, 24 Sep 2024 11:40:30 +0200 Subject: [PATCH] feature: rotation on block component --- Assets/Prefabs/Block.prefab | 121 ++- Assets/Prefabs/DeformAnchor.prefab | 2 +- Assets/Prefabs/RotateAnchor.prefab | 302 +++++++ Assets/Prefabs/RotateAnchor.prefab.meta | 7 + .../XRI Default Input Actions.inputactions | 20 + Assets/Scenes/SampleScene.unity | 76 +- Assets/Scrips/Components.meta | 8 + Assets/Scrips/Components/Block.meta | 8 + .../{ => Components/Block}/BlockDeform.cs | 32 +- .../Block}/BlockDeform.cs.meta | 0 Assets/Scrips/Components/Block/BlockRotate.cs | 130 +++ .../Components/Block/BlockRotate.cs.meta | 11 + .../{ => Components/Block}/DeformAnchor.cs | 0 .../Block}/DeformAnchor.cs.meta | 0 .../Scrips/Components/Block/RotateAnchor.cs | 76 ++ .../Components/Block/RotateAnchor.cs.meta | 11 + Assets/Scrips/Contexts.meta | 8 + Assets/Scrips/Contexts/EditState.cs | 74 ++ Assets/Scrips/Contexts/EditState.cs.meta | 11 + Assets/Scrips/Events.meta | 8 + Assets/Scrips/{ => Events}/SpawnBlockEvent.cs | 5 +- .../{ => Events}/SpawnBlockEvent.cs.meta | 0 .../SampleScene.scenetemplate | 26 +- Assets/Shaders/Mat_RotateAnchor.mat | 59 ++ Assets/Shaders/Mat_RotateAnchor.mat.meta | 8 + Assets/Shaders/RotateAnchorShader.shadergraph | 852 ++++++++++++++++++ .../RotateAnchorShader.shadergraph.meta | 10 + .../Materials/Pointer/Pointer Outline.mat | 15 +- 28 files changed, 1786 insertions(+), 94 deletions(-) create mode 100644 Assets/Prefabs/RotateAnchor.prefab create mode 100644 Assets/Prefabs/RotateAnchor.prefab.meta create mode 100644 Assets/Scrips/Components.meta create mode 100644 Assets/Scrips/Components/Block.meta rename Assets/Scrips/{ => Components/Block}/BlockDeform.cs (81%) rename Assets/Scrips/{ => Components/Block}/BlockDeform.cs.meta (100%) create mode 100644 Assets/Scrips/Components/Block/BlockRotate.cs create mode 100644 Assets/Scrips/Components/Block/BlockRotate.cs.meta rename Assets/Scrips/{ => Components/Block}/DeformAnchor.cs (100%) rename Assets/Scrips/{ => Components/Block}/DeformAnchor.cs.meta (100%) create mode 100644 Assets/Scrips/Components/Block/RotateAnchor.cs create mode 100644 Assets/Scrips/Components/Block/RotateAnchor.cs.meta create mode 100644 Assets/Scrips/Contexts.meta create mode 100644 Assets/Scrips/Contexts/EditState.cs create mode 100644 Assets/Scrips/Contexts/EditState.cs.meta create mode 100644 Assets/Scrips/Events.meta rename Assets/Scrips/{ => Events}/SpawnBlockEvent.cs (92%) rename Assets/Scrips/{ => Events}/SpawnBlockEvent.cs.meta (100%) create mode 100644 Assets/Shaders/Mat_RotateAnchor.mat create mode 100644 Assets/Shaders/Mat_RotateAnchor.mat.meta create mode 100644 Assets/Shaders/RotateAnchorShader.shadergraph create mode 100644 Assets/Shaders/RotateAnchorShader.shadergraph.meta diff --git a/Assets/Prefabs/Block.prefab b/Assets/Prefabs/Block.prefab index 9188e3b..749259b 100644 --- a/Assets/Prefabs/Block.prefab +++ b/Assets/Prefabs/Block.prefab @@ -13,6 +13,8 @@ GameObject: - component: {fileID: 7193593906906610129} - component: {fileID: 1779685088826987312} - component: {fileID: 3268846158774871891} + - component: {fileID: -4358216392600172306} + - component: {fileID: 7216982225745790517} m_Layer: 0 m_Name: Block m_TagString: surface @@ -63,6 +65,7 @@ MeshRenderer: m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: + - {fileID: 2100000, guid: c359cf48bf292794a85c2ec4eef04976, type: 2} - {fileID: 2100000, guid: f7d23c7a57a992c4282494782cba5215, type: 2} m_StaticBatchInfo: firstSubMesh: 0 @@ -99,7 +102,6 @@ MonoBehaviour: m_EditorClassIdentifier: deformAnchorPrefab: {fileID: 2720765159515821108, guid: 46377d8bcd3914149bbb7c475d721f56, type: 3} wrapDistance: 0.01 - grabTransparency: 0.5 --- !u!64 &3268846158774871891 MeshCollider: m_ObjectHideFlags: 0 @@ -122,3 +124,120 @@ MeshCollider: m_Convex: 0 m_CookingOptions: 30 m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!114 &-4358216392600172306 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8126816444565180231} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f2d45cd944da053459e522d9eb6936c1, type: 3} + m_Name: + m_EditorClassIdentifier: + RotateAnchorPrefab: {fileID: 2874721107243629612, guid: 12accfaeb3e281a48acb41e0100ee76d, type: 3} + inputTransform: {fileID: 0} + activateRotation: {fileID: 4987378303488695193, guid: c348712bda248c246b8c49b3db54643f, type: 3} +--- !u!114 &7216982225745790517 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8126816444565180231} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8a35f6cfbfba9b548aaa00d52cfe8a50, type: 3} + m_Name: + m_EditorClassIdentifier: + m_InteractionManager: {fileID: 0} + m_Colliders: [] + m_InteractionLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_InteractionLayers: + m_Bits: 1 + m_DistanceCalculationMode: 1 + m_SelectMode: 0 + m_FocusMode: 1 + m_CustomReticle: {fileID: 0} + m_AllowGazeInteraction: 0 + m_AllowGazeSelect: 0 + m_OverrideGazeTimeToSelect: 0 + m_GazeTimeToSelect: 0.5 + m_OverrideTimeToAutoDeselectGaze: 0 + m_TimeToAutoDeselectGaze: 3 + m_AllowGazeAssistance: 0 + m_FirstHoverEntered: + m_PersistentCalls: + m_Calls: [] + m_LastHoverExited: + m_PersistentCalls: + m_Calls: [] + m_HoverEntered: + m_PersistentCalls: + m_Calls: [] + m_HoverExited: + m_PersistentCalls: + m_Calls: [] + m_FirstSelectEntered: + m_PersistentCalls: + m_Calls: [] + m_LastSelectExited: + m_PersistentCalls: + m_Calls: [] + m_SelectEntered: + m_PersistentCalls: + m_Calls: [] + m_SelectExited: + m_PersistentCalls: + m_Calls: [] + m_FirstFocusEntered: + m_PersistentCalls: + m_Calls: [] + m_LastFocusExited: + m_PersistentCalls: + m_Calls: [] + m_FocusEntered: + m_PersistentCalls: + m_Calls: [] + m_FocusExited: + m_PersistentCalls: + m_Calls: [] + m_Activated: + m_PersistentCalls: + m_Calls: [] + m_Deactivated: + m_PersistentCalls: + m_Calls: [] + m_StartingHoverFilters: [] + m_StartingSelectFilters: [] + m_StartingInteractionStrengthFilters: [] + m_OnFirstHoverEntered: + m_PersistentCalls: + m_Calls: [] + m_OnLastHoverExited: + m_PersistentCalls: + m_Calls: [] + m_OnHoverEntered: + m_PersistentCalls: + m_Calls: [] + m_OnHoverExited: + m_PersistentCalls: + m_Calls: [] + m_OnSelectEntered: + m_PersistentCalls: + m_Calls: [] + m_OnSelectExited: + m_PersistentCalls: + m_Calls: [] + m_OnSelectCanceled: + m_PersistentCalls: + m_Calls: [] + m_OnActivate: + m_PersistentCalls: + m_Calls: [] + m_OnDeactivate: + m_PersistentCalls: + m_Calls: [] diff --git a/Assets/Prefabs/DeformAnchor.prefab b/Assets/Prefabs/DeformAnchor.prefab index e793243..ba5621c 100644 --- a/Assets/Prefabs/DeformAnchor.prefab +++ b/Assets/Prefabs/DeformAnchor.prefab @@ -135,7 +135,7 @@ Rigidbody: m_UseGravity: 0 m_IsKinematic: 1 m_Interpolate: 0 - m_Constraints: 112 + m_Constraints: 0 m_CollisionDetection: 0 --- !u!114 &4264957023403141933 MonoBehaviour: diff --git a/Assets/Prefabs/RotateAnchor.prefab b/Assets/Prefabs/RotateAnchor.prefab new file mode 100644 index 0000000..7b182ea --- /dev/null +++ b/Assets/Prefabs/RotateAnchor.prefab @@ -0,0 +1,302 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &2874721107243629612 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6569504317829715943} + - component: {fileID: 4698644511594186719} + - component: {fileID: 7552494850332456284} + - component: {fileID: 6113774950800744279} + - component: {fileID: 7323253822270363632} + - component: {fileID: 275422780297960133} + - component: {fileID: -7017312379455192587} + m_Layer: 0 + m_Name: RotateAnchor + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6569504317829715943 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2874721107243629612} + serializedVersion: 2 + 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_ConstrainProportionsScale: 1 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &4698644511594186719 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2874721107243629612} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &7552494850332456284 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2874721107243629612} + 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: c359cf48bf292794a85c2ec4eef04976, type: 2} + - {fileID: 2100000, guid: bf6a673a7ceb9fd45968b0283b67b5bf, 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!65 &6113774950800744279 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2874721107243629612} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!54 &7323253822270363632 +Rigidbody: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2874721107243629612} + serializedVersion: 4 + m_Mass: 1 + m_Drag: 0 + m_AngularDrag: 0.05 + m_CenterOfMass: {x: 0, y: 0, z: 0} + m_InertiaTensor: {x: 1, y: 1, z: 1} + m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ImplicitCom: 1 + m_ImplicitTensor: 1 + m_UseGravity: 1 + m_IsKinematic: 0 + m_Interpolate: 0 + m_Constraints: 14 + m_CollisionDetection: 0 +--- !u!114 &275422780297960133 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2874721107243629612} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0ad34abafad169848a38072baa96cdb2, type: 3} + m_Name: + m_EditorClassIdentifier: + m_InteractionManager: {fileID: 0} + m_Colliders: [] + m_InteractionLayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_InteractionLayers: + m_Bits: 1 + m_DistanceCalculationMode: 1 + m_SelectMode: 0 + m_FocusMode: 1 + m_CustomReticle: {fileID: 0} + m_AllowGazeInteraction: 0 + m_AllowGazeSelect: 0 + m_OverrideGazeTimeToSelect: 0 + m_GazeTimeToSelect: 0.5 + m_OverrideTimeToAutoDeselectGaze: 0 + m_TimeToAutoDeselectGaze: 3 + m_AllowGazeAssistance: 0 + m_FirstHoverEntered: + m_PersistentCalls: + m_Calls: [] + m_LastHoverExited: + m_PersistentCalls: + m_Calls: [] + m_HoverEntered: + m_PersistentCalls: + m_Calls: [] + m_HoverExited: + m_PersistentCalls: + m_Calls: [] + m_FirstSelectEntered: + m_PersistentCalls: + m_Calls: [] + m_LastSelectExited: + m_PersistentCalls: + m_Calls: [] + m_SelectEntered: + m_PersistentCalls: + m_Calls: [] + m_SelectExited: + m_PersistentCalls: + m_Calls: [] + m_FirstFocusEntered: + m_PersistentCalls: + m_Calls: [] + m_LastFocusExited: + m_PersistentCalls: + m_Calls: [] + m_FocusEntered: + m_PersistentCalls: + m_Calls: [] + m_FocusExited: + m_PersistentCalls: + m_Calls: [] + m_Activated: + m_PersistentCalls: + m_Calls: [] + m_Deactivated: + m_PersistentCalls: + m_Calls: [] + m_StartingHoverFilters: [] + m_StartingSelectFilters: [] + m_StartingInteractionStrengthFilters: [] + m_OnFirstHoverEntered: + m_PersistentCalls: + m_Calls: [] + m_OnLastHoverExited: + m_PersistentCalls: + m_Calls: [] + m_OnHoverEntered: + m_PersistentCalls: + m_Calls: [] + m_OnHoverExited: + m_PersistentCalls: + m_Calls: [] + m_OnSelectEntered: + m_PersistentCalls: + m_Calls: [] + m_OnSelectExited: + m_PersistentCalls: + m_Calls: [] + m_OnSelectCanceled: + m_PersistentCalls: + m_Calls: [] + m_OnActivate: + m_PersistentCalls: + m_Calls: [] + m_OnDeactivate: + m_PersistentCalls: + m_Calls: [] + m_AttachTransform: {fileID: 0} + m_SecondaryAttachTransform: {fileID: 0} + m_UseDynamicAttach: 1 + m_MatchAttachPosition: 0 + m_MatchAttachRotation: 1 + m_SnapToColliderVolume: 1 + m_ReinitializeDynamicAttachEverySingleGrab: 0 + m_AttachEaseInTime: 0.15 + m_MovementType: 2 + m_VelocityDamping: 1 + m_VelocityScale: 1 + m_AngularVelocityDamping: 1 + m_AngularVelocityScale: 1 + m_TrackPosition: 0 + m_SmoothPosition: 0 + m_SmoothPositionAmount: 8 + m_TightenPosition: 0.1 + m_TrackRotation: 1 + m_SmoothRotation: 0 + m_SmoothRotationAmount: 8 + m_TightenRotation: 0.1 + m_TrackScale: 0 + m_SmoothScale: 0 + m_SmoothScaleAmount: 8 + m_TightenScale: 0.1 + m_ThrowOnDetach: 0 + m_ThrowSmoothingDuration: 0.25 + m_ThrowSmoothingCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 1 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0 + outWeight: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + m_ThrowVelocityScale: 1.5 + m_ThrowAngularVelocityScale: 1 + m_ForceGravityOnDetach: 0 + m_RetainTransformParent: 1 + m_AttachPointCompatibilityMode: 0 + m_StartingSingleGrabTransformers: [] + m_StartingMultipleGrabTransformers: [] + m_AddDefaultGrabTransformers: 1 +--- !u!114 &-7017312379455192587 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2874721107243629612} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 31ea8118381092a4cbda006e4169b63d, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/Assets/Prefabs/RotateAnchor.prefab.meta b/Assets/Prefabs/RotateAnchor.prefab.meta new file mode 100644 index 0000000..ebebf8c --- /dev/null +++ b/Assets/Prefabs/RotateAnchor.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 12accfaeb3e281a48acb41e0100ee76d +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/XR Interaction Toolkit/2.4.3/Starter Assets/XRI Default Input Actions.inputactions b/Assets/Samples/XR Interaction Toolkit/2.4.3/Starter Assets/XRI Default Input Actions.inputactions index 16ee2de..7fecfee 100644 --- a/Assets/Samples/XR Interaction Toolkit/2.4.3/Starter Assets/XRI Default Input Actions.inputactions +++ b/Assets/Samples/XR Interaction Toolkit/2.4.3/Starter Assets/XRI Default Input Actions.inputactions @@ -1426,6 +1426,15 @@ "processors": "", "interactions": "", "initialStateCheck": false + }, + { + "name": "SwitchEditMode", + "type": "Button", + "id": "511b691c-e9aa-4c03-acf7-1f4e6b736b7e", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": false } ], "bindings": [ @@ -1582,6 +1591,17 @@ "action": "SpawnBlock", "isComposite": false, "isPartOfComposite": false + }, + { + "name": "", + "id": "97458e02-649a-4de9-857a-734b4f5850f6", + "path": "<XRController>{RightHand}/{SecondaryButton}", + "interactions": "", + "processors": "", + "groups": "Generic XR Controller", + "action": "SwitchEditMode", + "isComposite": false, + "isPartOfComposite": false } ] }, diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity index b730aa6..8a303a4 100644 --- a/Assets/Scenes/SampleScene.unity +++ b/Assets/Scenes/SampleScene.unity @@ -4471,6 +4471,7 @@ GameObject: m_Component: - component: {fileID: 426651920} - component: {fileID: 426651919} + - component: {fileID: 426651921} m_Layer: 0 m_Name: Spawn Block Handler m_TagString: Untagged @@ -4508,6 +4509,19 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &426651921 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 426651918} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ba56a00a41004944894e2bc62ef7554e, type: 3} + m_Name: + m_EditorClassIdentifier: + editStateAction: {fileID: 2052445844685558139, guid: c348712bda248c246b8c49b3db54643f, type: 3} --- !u!1001 &427008753 PrefabInstance: m_ObjectHideFlags: 0 @@ -8651,7 +8665,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: -8679921383154817045, guid: c6984c48aed9a154294088f4265d8478, type: 3} propertyPath: m_LocalPosition.x - value: -0.449 + value: -0.58 objectReference: {fileID: 0} - target: {fileID: -8679921383154817045, guid: c6984c48aed9a154294088f4265d8478, type: 3} propertyPath: m_LocalPosition.y @@ -8659,7 +8673,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: -8679921383154817045, guid: c6984c48aed9a154294088f4265d8478, type: 3} propertyPath: m_LocalPosition.z - value: -2.345 + value: -2.331 objectReference: {fileID: 0} - target: {fileID: -8679921383154817045, guid: c6984c48aed9a154294088f4265d8478, type: 3} propertyPath: m_LocalRotation.w @@ -23639,63 +23653,6 @@ Transform: - {fileID: 1407816929} m_Father: {fileID: 817075156} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1001 &5583875121440826956 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 4336518853162009200, guid: a8cb4e31c32938946b7351585af6bc07, type: 3} - propertyPath: m_Name - value: BlockSide - objectReference: {fileID: 0} - - target: {fileID: 7933363895158644391, guid: a8cb4e31c32938946b7351585af6bc07, type: 3} - propertyPath: m_LocalPosition.x - value: 8.238 - objectReference: {fileID: 0} - - target: {fileID: 7933363895158644391, guid: a8cb4e31c32938946b7351585af6bc07, type: 3} - propertyPath: m_LocalPosition.y - value: 0.2525534 - objectReference: {fileID: 0} - - target: {fileID: 7933363895158644391, guid: a8cb4e31c32938946b7351585af6bc07, type: 3} - propertyPath: m_LocalPosition.z - value: 3.7599 - objectReference: {fileID: 0} - - target: {fileID: 7933363895158644391, guid: a8cb4e31c32938946b7351585af6bc07, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 7933363895158644391, guid: a8cb4e31c32938946b7351585af6bc07, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7933363895158644391, guid: a8cb4e31c32938946b7351585af6bc07, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7933363895158644391, guid: a8cb4e31c32938946b7351585af6bc07, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7933363895158644391, guid: a8cb4e31c32938946b7351585af6bc07, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7933363895158644391, guid: a8cb4e31c32938946b7351585af6bc07, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7933363895158644391, guid: a8cb4e31c32938946b7351585af6bc07, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: a8cb4e31c32938946b7351585af6bc07, type: 3} --- !u!23 &7718390322663337749 MeshRenderer: m_ObjectHideFlags: 0 @@ -24768,4 +24725,3 @@ SceneRoots: - {fileID: 704002919} - {fileID: 1165990525} - {fileID: 426651920} - - {fileID: 5583875121440826956} diff --git a/Assets/Scrips/Components.meta b/Assets/Scrips/Components.meta new file mode 100644 index 0000000..33822ae --- /dev/null +++ b/Assets/Scrips/Components.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bd2fc3e48106ed24fbc9e78f4bdeab13 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scrips/Components/Block.meta b/Assets/Scrips/Components/Block.meta new file mode 100644 index 0000000..c0c7de1 --- /dev/null +++ b/Assets/Scrips/Components/Block.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3e3545a8e106487479b5e6892e2b58e9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scrips/BlockDeform.cs b/Assets/Scrips/Components/Block/BlockDeform.cs similarity index 81% rename from Assets/Scrips/BlockDeform.cs rename to Assets/Scrips/Components/Block/BlockDeform.cs index c62d80f..a21625f 100644 --- a/Assets/Scrips/BlockDeform.cs +++ b/Assets/Scrips/Components/Block/BlockDeform.cs @@ -6,10 +6,10 @@ public class BlockDeform : MonoBehaviour { public GameObject deformAnchorPrefab; public float wrapDistance; - public float grabTransparency; private Mesh _mesh; private readonly DeformAnchor[] _deformAnchors = new DeformAnchor[6]; + private readonly GameObject[] _spawnedAnchors = new GameObject[6]; private bool IsPointOnPlane(Vector3 point, Vector3 normal, Vector3 pointOnPlane, double epsilon) { @@ -22,7 +22,6 @@ public class BlockDeform : MonoBehaviour public void HandleAnchorGrabbed(Transform endPosition, Vector3 startPosition, DeformAnchor anchor) { - Vector3 normal = this.transform.rotation.normalized * anchor.GetNormal(); // calculate deformation @@ -107,29 +106,27 @@ public class BlockDeform : MonoBehaviour _mesh = this.GetComponent<MeshFilter>().mesh; Collider blockCollider = this.GetComponent<Collider>(); - DeformAnchor[] deformAnchorsScripts = new DeformAnchor[_deformAnchors.Length]; for (int i = 0; i < 6; i++) { GameObject anchor = Instantiate(deformAnchorPrefab, this.transform.position, Quaternion.identity); + anchor.transform.parent = this.transform; _deformAnchors[i] = anchor.GetComponent<DeformAnchor>(); - _deformAnchors[i].transform.parent = this.transform; - _deformAnchors[i].transform.position = this.transform.position; - deformAnchorsScripts[i] = _deformAnchors[i].GetComponent<DeformAnchor>(); + _spawnedAnchors[i] = anchor; } // z axis anchor setup - deformAnchorsScripts[0].SetupAnchor(this, this.transform.forward, blockCollider.bounds.extents, wrapDistance); - deformAnchorsScripts[1].SetupAnchor(this, -this.transform.forward, blockCollider.bounds.extents, wrapDistance); + _deformAnchors[0].SetupAnchor(this, this.transform.forward, blockCollider.bounds.extents, wrapDistance); + _deformAnchors[1].SetupAnchor(this, -this.transform.forward, blockCollider.bounds.extents, wrapDistance); // y axis achor setup - deformAnchorsScripts[2].SetupAnchor(this, this.transform.up, blockCollider.bounds.extents, wrapDistance); - deformAnchorsScripts[3].SetupAnchor(this, -this.transform.up, blockCollider.bounds.extents, wrapDistance); + _deformAnchors[2].SetupAnchor(this, this.transform.up, blockCollider.bounds.extents, wrapDistance); + _deformAnchors[3].SetupAnchor(this, -this.transform.up, blockCollider.bounds.extents, wrapDistance); // x axis anchor setup - deformAnchorsScripts[4].SetupAnchor(this, this.transform.right, blockCollider.bounds.extents, wrapDistance); - deformAnchorsScripts[5].SetupAnchor(this, -this.transform.right, blockCollider.bounds.extents, wrapDistance); + _deformAnchors[4].SetupAnchor(this, this.transform.right, blockCollider.bounds.extents, wrapDistance); + _deformAnchors[5].SetupAnchor(this, -this.transform.right, blockCollider.bounds.extents, wrapDistance); } @@ -139,6 +136,15 @@ public class BlockDeform : MonoBehaviour } + private void FixedUpdate() + { + EditState.EditType mode = EditState.Instance._editState; + foreach (GameObject anchor in _spawnedAnchors) + { + anchor.SetActive(mode == EditState.EditType.Deform); + } + } + public Vector3 GetPosition() { return transform.position; @@ -153,7 +159,7 @@ public class BlockDeform : MonoBehaviour public void EnableTransparency() { Color color = transform.GetComponent<Renderer>().material.GetColor("_BaseColor"); - color.a = grabTransparency; + // color.a = grabTransparency; transform.GetComponent<Renderer>().material.SetColor("_BaseColor", color); } diff --git a/Assets/Scrips/BlockDeform.cs.meta b/Assets/Scrips/Components/Block/BlockDeform.cs.meta similarity index 100% rename from Assets/Scrips/BlockDeform.cs.meta rename to Assets/Scrips/Components/Block/BlockDeform.cs.meta diff --git a/Assets/Scrips/Components/Block/BlockRotate.cs b/Assets/Scrips/Components/Block/BlockRotate.cs new file mode 100644 index 0000000..ff69295 --- /dev/null +++ b/Assets/Scrips/Components/Block/BlockRotate.cs @@ -0,0 +1,130 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.InputSystem; +using UnityEngine.XR.Interaction.Toolkit; + +public class BlockRotate : MonoBehaviour +{ + public GameObject RotateAnchorPrefab; + public Transform inputTransform; + public InputActionReference activateRotation; + + private GameObject _rotateAnchor; + private XRSimpleInteractable _simpleInteractable; + + private MeshRenderer _meshRenderer; + + private void AcitvateRotationMode(InputAction.CallbackContext context) + { + if (inputTransform == null) + { + Debug.LogWarning("No input transform assigned to block rotate"); + return; + } + + EditState.EditType mode = EditState.Instance._editState; + if (mode == EditState.EditType.Rotate && + Physics.Raycast(inputTransform.position, inputTransform.forward, out RaycastHit hit)) + { + if (hit.transform.gameObject == this.transform.gameObject) + { + _rotateAnchor.SetActive(true); + _rotateAnchor.transform.position = inputTransform.position + inputTransform.forward * 0.5f; + } + } + + if (mode == EditState.EditType.Deform) _rotateAnchor.SetActive(false); + } + + public void HandleRotateAnchor() + { + this.transform.eulerAngles = _rotateAnchor.transform.eulerAngles; + } + + private void Awake() + { + _simpleInteractable = GetComponent<XRSimpleInteractable>(); + _simpleInteractable.hoverEntered.AddListener(HandleHoverEnter); + _simpleInteractable.hoverExited.AddListener(HandleHoverExit); + + activateRotation.action.Enable(); + activateRotation.action.performed += AcitvateRotationMode; + InputSystem.onDeviceChange += OnDeviceChange; + + this._meshRenderer = GetComponent<MeshRenderer>(); + _meshRenderer.material = new Material(_meshRenderer.material); + } + + private void HandleHoverExit(HoverExitEventArgs arg0) + { + SetOutline(1f); + } + + private void HandleHoverEnter(HoverEnterEventArgs arg0) + { + EditState.EditType mode = EditState.Instance._editState; + if (mode == EditState.EditType.Deform) + { + SetOutline(1f); + return; + } + SetOutline(1.03f); + } + + private void SetOutline(float thickness) + { + try + { + Material mat = _meshRenderer.material; + mat.SetFloat("_OutlineThickness", thickness); + } + catch + { + Debug.LogWarning("No material found on RotateAnchor."); + } + } + + private void OnDestroy() + { + activateRotation.action.Disable(); + activateRotation.action.performed -= AcitvateRotationMode; + InputSystem.onDeviceChange -= OnDeviceChange; + } + + private void OnDeviceChange(InputDevice device, InputDeviceChange change) + { + switch (change) + { + case InputDeviceChange.Disconnected: + activateRotation.action.Disable(); + activateRotation.action.performed -= AcitvateRotationMode; + break; + case InputDeviceChange.Reconnected: + activateRotation.action.Enable(); + activateRotation.action.performed += AcitvateRotationMode; + break; + } + } + + private void FixedUpdate() + { + EditState.EditType mode = EditState.Instance._editState; + _rotateAnchor.SetActive(mode == EditState.EditType.Rotate); + } + + // Start is called before the first frame update + void Start() + { + _rotateAnchor = Instantiate(RotateAnchorPrefab, this.transform.position, Quaternion.identity); + _rotateAnchor.GetComponent<RotateAnchor>().Initialize(this); + _rotateAnchor.SetActive(false); + } + + // Update is called once per frame + void Update() + { + + } +} diff --git a/Assets/Scrips/Components/Block/BlockRotate.cs.meta b/Assets/Scrips/Components/Block/BlockRotate.cs.meta new file mode 100644 index 0000000..b54edce --- /dev/null +++ b/Assets/Scrips/Components/Block/BlockRotate.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f2d45cd944da053459e522d9eb6936c1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scrips/DeformAnchor.cs b/Assets/Scrips/Components/Block/DeformAnchor.cs similarity index 100% rename from Assets/Scrips/DeformAnchor.cs rename to Assets/Scrips/Components/Block/DeformAnchor.cs diff --git a/Assets/Scrips/DeformAnchor.cs.meta b/Assets/Scrips/Components/Block/DeformAnchor.cs.meta similarity index 100% rename from Assets/Scrips/DeformAnchor.cs.meta rename to Assets/Scrips/Components/Block/DeformAnchor.cs.meta diff --git a/Assets/Scrips/Components/Block/RotateAnchor.cs b/Assets/Scrips/Components/Block/RotateAnchor.cs new file mode 100644 index 0000000..cbc3d36 --- /dev/null +++ b/Assets/Scrips/Components/Block/RotateAnchor.cs @@ -0,0 +1,76 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.XR.Interaction.Toolkit; + +public class RotateAnchor : MonoBehaviour +{ + private BlockRotate _blockRotate; + private XRGrabInteractable _grabInteractable; + private bool _active = false; + + private MeshRenderer _meshRenderer; + + void Awake() + { + _grabInteractable = GetComponent<XRGrabInteractable>(); + _grabInteractable.selectExited.AddListener(HandleSelectExit); + _grabInteractable.selectEntered.AddListener(HandleSelectEnter); + _grabInteractable.hoverEntered.AddListener(HandleHoverEnter); + _grabInteractable.hoverExited.AddListener(HandleHoverExit); + + this._meshRenderer = GetComponent<MeshRenderer>(); + _meshRenderer.material = new Material(_meshRenderer.material); + _meshRenderer.material.SetColor("_OutlineColor", new Color(0.5f, 0.5f, 1.0f)); + } + + private void HandleSelectEnter(SelectEnterEventArgs arg0) + { + _active = true; + SetOutline(1.05f); + } + + private void HandleHoverExit(HoverExitEventArgs arg0) + { + if (!_active) + SetOutline(1f); + } + + private void HandleHoverEnter(HoverEnterEventArgs arg0) + { + SetOutline(1.05f); + } + + private void HandleSelectExit(SelectExitEventArgs arg0) + { + _blockRotate.HandleRotateAnchor(); + _active = false; + SetOutline(1f); + } + + // outline shader tutorial: https://youtu.be/JCXYR_5vhNc?si=wo-_gn51tbL7_1mX + private void SetOutline(float thickness) + { + try + { + Material mat = _meshRenderer.material; + mat.SetFloat("_OutlineThickness", thickness); + } + catch + { + Debug.LogWarning("No material found on RotateAnchor."); + } + } + + // Update is called once per frame + void Update() + { + + } + + public void Initialize(BlockRotate blockRotate) + { + this._blockRotate = blockRotate; + } +} diff --git a/Assets/Scrips/Components/Block/RotateAnchor.cs.meta b/Assets/Scrips/Components/Block/RotateAnchor.cs.meta new file mode 100644 index 0000000..5b5cf4c --- /dev/null +++ b/Assets/Scrips/Components/Block/RotateAnchor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 31ea8118381092a4cbda006e4169b63d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scrips/Contexts.meta b/Assets/Scrips/Contexts.meta new file mode 100644 index 0000000..8ff5f42 --- /dev/null +++ b/Assets/Scrips/Contexts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 56041249793681c46845d49fa40d9aa0 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scrips/Contexts/EditState.cs b/Assets/Scrips/Contexts/EditState.cs new file mode 100644 index 0000000..229ad29 --- /dev/null +++ b/Assets/Scrips/Contexts/EditState.cs @@ -0,0 +1,74 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.InputSystem; + +public class EditState : MonoBehaviour +{ + public static EditState Instance { get; private set; } + public InputActionReference editStateAction; + + public enum EditType + { + Deform = 0, + Rotate = 1 + } + + public EditType _editState { get; private set; } + + private void SwitchState(InputAction.CallbackContext context) + { + _editState = (_editState == EditType.Deform) ? EditType.Rotate : EditType.Deform; + Debug.Log(_editState); + } + + private void Awake() + { + if (Instance != null && Instance != this) + { + Destroy(this); + } + else + { + Instance = this; + } + + editStateAction.action.Enable(); + editStateAction.action.performed += SwitchState; + InputSystem.onDeviceChange += OnDeviceChange; + } + + private void OnDestroy() + { + editStateAction.action.Disable(); + editStateAction.action.performed -= SwitchState; + InputSystem.onDeviceChange -= OnDeviceChange; + } + + private void OnDeviceChange(InputDevice device, InputDeviceChange change) + { + switch (change) + { + case InputDeviceChange.Disconnected: + editStateAction.action.Disable(); + editStateAction.action.performed -= SwitchState; + break; + case InputDeviceChange.Reconnected: + editStateAction.action.Enable(); + editStateAction.action.performed += SwitchState; + break; + } + } + + // Start is called before the first frame update + void Start() + { + _editState = EditType.Deform; + } + + // Update is called once per frame + void Update() + { + + } +} diff --git a/Assets/Scrips/Contexts/EditState.cs.meta b/Assets/Scrips/Contexts/EditState.cs.meta new file mode 100644 index 0000000..f215ae1 --- /dev/null +++ b/Assets/Scrips/Contexts/EditState.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ba56a00a41004944894e2bc62ef7554e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scrips/Events.meta b/Assets/Scrips/Events.meta new file mode 100644 index 0000000..0ade50f --- /dev/null +++ b/Assets/Scrips/Events.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 97e53dbfcd989f3459bcc419f53a3644 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scrips/SpawnBlockEvent.cs b/Assets/Scrips/Events/SpawnBlockEvent.cs similarity index 92% rename from Assets/Scrips/SpawnBlockEvent.cs rename to Assets/Scrips/Events/SpawnBlockEvent.cs index 150ebd7..a219c7c 100644 --- a/Assets/Scrips/SpawnBlockEvent.cs +++ b/Assets/Scrips/Events/SpawnBlockEvent.cs @@ -13,6 +13,8 @@ public class SpawnBlockEvent : MonoBehaviour private void Awake() { + spawnPrefab.GetComponent<BlockRotate>().inputTransform = this.inputTransform; + triggerEventAction.action.Enable(); triggerEventAction.action.performed += SpawnMesh; InputSystem.onDeviceChange += OnDeviceChange; @@ -27,7 +29,8 @@ public class SpawnBlockEvent : MonoBehaviour private void SpawnMesh(InputAction.CallbackContext context) { - + EditState.EditType mode = EditState.Instance._editState; + if (mode == EditState.EditType.Rotate) return; if (Physics.Raycast(inputTransform.position, inputTransform.forward, out RaycastHit hit)) { if (hit.transform.gameObject.CompareTag("surface")) diff --git a/Assets/Scrips/SpawnBlockEvent.cs.meta b/Assets/Scrips/Events/SpawnBlockEvent.cs.meta similarity index 100% rename from Assets/Scrips/SpawnBlockEvent.cs.meta rename to Assets/Scrips/Events/SpawnBlockEvent.cs.meta diff --git a/Assets/Settings/Project Configuration/SampleScene.scenetemplate b/Assets/Settings/Project Configuration/SampleScene.scenetemplate index 4a681ff..476cf8d 100644 --- a/Assets/Settings/Project Configuration/SampleScene.scenetemplate +++ b/Assets/Settings/Project Configuration/SampleScene.scenetemplate @@ -272,22 +272,22 @@ MonoBehaviour: instantiationMode: 0 - dependency: {fileID: -927199367670048503, guid: 9a13b94cace2a4d78ac94a0ed0a88843, type: 3} instantiationMode: 0 - - dependency: {fileID: 2100000, guid: c07dd69158c788946aa2d944960f264d, type: 2} + - dependency: {fileID: 919132149155446097, guid: 436757056de26e144b330984c539cecd, type: 3} instantiationMode: 0 - dependency: {fileID: 11400000, guid: fbb7c6a04be6d8341934b839f24b42e1, type: 2} instantiationMode: 1 - dependency: {fileID: 2800000, guid: 7438999bc10061a4db23c995a4d56f21, type: 3} instantiationMode: 0 - - dependency: {fileID: 919132149155446097, guid: 436757056de26e144b330984c539cecd, type: 3} + - dependency: {fileID: 4125421792874400280, guid: 27024f5809f4a4347b9cd7f26a1bdf93, type: 3} instantiationMode: 0 - dependency: {fileID: 2800000, guid: a89d91b09ecb0164ab9d892915bfa299, type: 3} instantiationMode: 0 - - dependency: {fileID: 4125421792874400280, guid: 27024f5809f4a4347b9cd7f26a1bdf93, type: 3} - instantiationMode: 0 - dependency: {fileID: 2179057468902719980, guid: f47ad6ac315a3ea428b59e2cac6f2a2e, type: 3} instantiationMode: 0 - dependency: {fileID: 2800000, guid: e858167b0cba8014eb7e34d893d5596f, type: 3} instantiationMode: 0 + - dependency: {fileID: 2100000, guid: c359cf48bf292794a85c2ec4eef04976, type: 2} + instantiationMode: 0 - dependency: {fileID: 2800000, guid: ee148e281f3c41c5b4ff5f8a5afe5a6c, type: 3} instantiationMode: 1 - dependency: {fileID: 5648130919276084443, guid: 085ce58b196caa446a8545c9dd388793, type: 3} @@ -296,40 +296,40 @@ MonoBehaviour: instantiationMode: 1 - dependency: {fileID: 2100000, guid: ec46d2188d4b8774e847e75f1e12a8db, type: 2} instantiationMode: 0 - - dependency: {fileID: 2800000, guid: 58bc8d49e10d1bc40813d8974b8b3a5c, type: 3} + - dependency: {fileID: 2100000, guid: 033b96ca728b63840ae3bb7661f1d2b5, type: 2} instantiationMode: 0 - dependency: {fileID: 919132149155446097, guid: abd83a5f2e97de448a64683eb362a566, type: 3} instantiationMode: 0 + - dependency: {fileID: 2800000, guid: 58bc8d49e10d1bc40813d8974b8b3a5c, type: 3} + instantiationMode: 0 - dependency: {fileID: 919132149155446097, guid: cec1aebf75b74914097378398b58a48e, type: 3} instantiationMode: 0 - dependency: {fileID: 2100000, guid: b2dbb5f1f2068794eba2d105124bf21e, type: 2} instantiationMode: 0 - - dependency: {fileID: 8138111287210361984, guid: 5d21b49507ba4104f983122e372d6595, type: 3} - instantiationMode: 0 - dependency: {fileID: 2800000, guid: 65d31ca9600c4654e886aa7bab36e94b, type: 3} instantiationMode: 0 - dependency: {fileID: 2100000, guid: f5cd77343d6ca1949b1d2d7511848832, type: 2} instantiationMode: 0 - dependency: {fileID: 2100000, guid: 456e2158124c0aa40bf9eceb850dfdb4, type: 2} instantiationMode: 0 - - dependency: {fileID: 4336518853162009200, guid: a8cb4e31c32938946b7351585af6bc07, type: 3} + - dependency: {fileID: 6262935102578480881, guid: 3405290cc9a00c34bbd425b05c494f62, type: 3} instantiationMode: 0 - dependency: {fileID: 2100000, guid: 08d0ccc4a501e6645be0c3ee36d0cd20, type: 2} instantiationMode: 0 - dependency: {fileID: 2800000, guid: 9d65b1540bd55dc4ab02643e09524306, type: 3} instantiationMode: 0 - - dependency: {fileID: 2100000, guid: 033b96ca728b63840ae3bb7661f1d2b5, type: 2} - instantiationMode: 0 - dependency: {fileID: 8134302614855669005, guid: c4a645c929982ea41a52b5037ee7d94d, type: 3} instantiationMode: 0 - - dependency: {fileID: 6262935102578480881, guid: 3405290cc9a00c34bbd425b05c494f62, type: 3} - instantiationMode: 0 - dependency: {fileID: 2800000, guid: de0113b98aad70a419960e61a7d8d6ef, type: 3} instantiationMode: 0 + - dependency: {fileID: 2800000, guid: 89c4d70ec8a71624f9f1ea880312974b, type: 3} + instantiationMode: 0 - dependency: {fileID: 8748868027195207512, guid: 893219773891c784ab469a39151879b4, type: 3} instantiationMode: 0 - dependency: {fileID: -944628639613478452, guid: c348712bda248c246b8c49b3db54643f, type: 3} instantiationMode: 1 + - dependency: {fileID: 2874721107243629612, guid: 12accfaeb3e281a48acb41e0100ee76d, type: 3} + instantiationMode: 0 - dependency: {fileID: 919132149155446097, guid: da7215fc737ba47489f5c28303aa0d81, type: 3} instantiationMode: 0 - dependency: {fileID: 919132149155446097, guid: a7a48ffe8eca1b6418fba110a2d48baa, type: 3} @@ -340,8 +340,6 @@ MonoBehaviour: instantiationMode: 0 - dependency: {fileID: 919132149155446097, guid: 0863a94853770ec459e2b729cb7fc574, type: 3} instantiationMode: 0 - - dependency: {fileID: 2800000, guid: 89c4d70ec8a71624f9f1ea880312974b, type: 3} - instantiationMode: 0 - dependency: {fileID: 2100000, guid: 29048254ac014fd46a1a8684451bffd8, type: 2} instantiationMode: 0 - dependency: {fileID: 11400000, guid: 2e498d1c8094910479dc3e1b768306a4, type: 2} diff --git a/Assets/Shaders/Mat_RotateAnchor.mat b/Assets/Shaders/Mat_RotateAnchor.mat new file mode 100644 index 0000000..b010308 --- /dev/null +++ b/Assets/Shaders/Mat_RotateAnchor.mat @@ -0,0 +1,59 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-5544145570760000029 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 7 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Mat_RotateAnchor + m_Shader: {fileID: -6465566751694194690, guid: c2e150b7ef7e5614eabcd8158db173ef, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _OutlineThickness: 1.05 + - _Outline_Thickness: 1 + - _QueueControl: 0 + - _QueueOffset: 0 + m_Colors: + - _OutlineColor: {r: 0.5529412, g: 1, b: 0.8861582, a: 0} + m_BuildTextureStacks: [] diff --git a/Assets/Shaders/Mat_RotateAnchor.mat.meta b/Assets/Shaders/Mat_RotateAnchor.mat.meta new file mode 100644 index 0000000..fb2a58f --- /dev/null +++ b/Assets/Shaders/Mat_RotateAnchor.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c359cf48bf292794a85c2ec4eef04976 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Shaders/RotateAnchorShader.shadergraph b/Assets/Shaders/RotateAnchorShader.shadergraph new file mode 100644 index 0000000..30b98cb --- /dev/null +++ b/Assets/Shaders/RotateAnchorShader.shadergraph @@ -0,0 +1,852 @@ +{ + "m_SGVersion": 3, + "m_Type": "UnityEditor.ShaderGraph.GraphData", + "m_ObjectId": "8e16303b48694b338128bc01716693ff", + "m_Properties": [ + { + "m_Id": "6f27c2c9fd1443c89632fdf7c8711e20" + }, + { + "m_Id": "fdf3d3e255ae4183a5553726645af92a" + } + ], + "m_Keywords": [], + "m_Dropdowns": [], + "m_CategoryData": [ + { + "m_Id": "bcc1343d7ba641c4826c159bbc4864eb" + } + ], + "m_Nodes": [ + { + "m_Id": "0843afe15d384947b618d3872cdb0b23" + }, + { + "m_Id": "f135575968df4de086c6b2a09c78c42a" + }, + { + "m_Id": "ace6a9b2694a4b959bdb23fd2b380e09" + }, + { + "m_Id": "ff4d67c3ac5b4481b9ec3ee425bbe04b" + }, + { + "m_Id": "dca90633999b48bdb2056aa84a63fd13" + }, + { + "m_Id": "6cf919ccf99a4e66ba2ee46c8d313c30" + }, + { + "m_Id": "5aa1ece8eac940bfaf95e1d5e1862abe" + }, + { + "m_Id": "d58d86e00fe54878b34c9c377b041111" + } + ], + "m_GroupDatas": [], + "m_StickyNoteDatas": [], + "m_Edges": [ + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "5aa1ece8eac940bfaf95e1d5e1862abe" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "0843afe15d384947b618d3872cdb0b23" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "6cf919ccf99a4e66ba2ee46c8d313c30" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "5aa1ece8eac940bfaf95e1d5e1862abe" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "d58d86e00fe54878b34c9c377b041111" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "ff4d67c3ac5b4481b9ec3ee425bbe04b" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "dca90633999b48bdb2056aa84a63fd13" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "5aa1ece8eac940bfaf95e1d5e1862abe" + }, + "m_SlotId": 1 + } + } + ], + "m_VertexContext": { + "m_Position": { + "x": 0.0, + "y": -23.0 + }, + "m_Blocks": [ + { + "m_Id": "0843afe15d384947b618d3872cdb0b23" + }, + { + "m_Id": "f135575968df4de086c6b2a09c78c42a" + }, + { + "m_Id": "ace6a9b2694a4b959bdb23fd2b380e09" + } + ] + }, + "m_FragmentContext": { + "m_Position": { + "x": 0.0, + "y": 200.0 + }, + "m_Blocks": [ + { + "m_Id": "ff4d67c3ac5b4481b9ec3ee425bbe04b" + } + ] + }, + "m_PreviewData": { + "serializedMesh": { + "m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}", + "m_Guid": "" + }, + "preventRotation": false + }, + "m_Path": "Shader Graphs", + "m_GraphPrecision": 1, + "m_PreviewMode": 2, + "m_OutputNode": { + "m_Id": "" + }, + "m_SubDatas": [], + "m_ActiveTargets": [ + { + "m_Id": "29e9a416c0084bc69fe73d96b686750b" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "0843afe15d384947b618d3872cdb0b23", + "m_Group": { + "m_Id": "" + }, + "m_Name": "VertexDescription.Position", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "a7f687bea27a4db6938bd312e2d62b85" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Position" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.TangentMaterialSlot", + "m_ObjectId": "220842e9adab449186142f4787f3bf02", + "m_Id": 0, + "m_DisplayName": "Tangent", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Tangent", + "m_StageCapability": 1, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_Space": 0 +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget", + "m_ObjectId": "29e9a416c0084bc69fe73d96b686750b", + "m_Datas": [], + "m_ActiveSubTarget": { + "m_Id": "70aa7d9924f34d9783d1596af7adea92" + }, + "m_AllowMaterialOverride": false, + "m_SurfaceType": 0, + "m_ZTestMode": 4, + "m_ZWriteControl": 0, + "m_AlphaMode": 0, + "m_RenderFace": 1, + "m_AlphaClip": false, + "m_CastShadows": true, + "m_ReceiveShadows": true, + "m_SupportsLODCrossFade": false, + "m_CustomEditorGUI": "", + "m_SupportVFX": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "3ebc23d58f384cdcb210ee6ea155bc9a", + "m_Id": 0, + "m_DisplayName": "OutlineThickness", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.MultiplyNode", + "m_ObjectId": "5aa1ece8eac940bfaf95e1d5e1862abe", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Multiply", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -283.0, + "y": -3.000002384185791, + "width": 129.99998474121095, + "height": 117.99998474121094 + } + }, + "m_Slots": [ + { + "m_Id": "9de2ad20c59b4cfd8502617f7c9048e9" + }, + { + "m_Id": "b441cb7e0f6c4cccabafce30db4c60f7" + }, + { + "m_Id": "cc8de72b4f02452f819aaf9288f8f813" + } + ], + "synonyms": [ + "multiplication", + "times", + "x" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.PositionNode", + "m_ObjectId": "6cf919ccf99a4e66ba2ee46c8d313c30", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Position", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -529.0, + "y": -3.0, + "width": 206.0, + "height": 131.0 + } + }, + "m_Slots": [ + { + "m_Id": "6f81c54afedb4121beec4c5dd20d49ca" + } + ], + "synonyms": [ + "location" + ], + "m_Precision": 1, + "m_PreviewExpanded": false, + "m_DismissedVersion": 0, + "m_PreviewMode": 2, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Space": 0, + "m_PositionSource": 0 +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "6f27c2c9fd1443c89632fdf7c8711e20", + "m_Guid": { + "m_GuidSerialized": "209f26a0-9799-416f-9b69-da7909f0a1e4" + }, + "m_Name": "OutlineThickness", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "OutlineThickness", + "m_DefaultReferenceName": "_OutlineThickness", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": true, + "hlslDeclarationOverride": 3, + "m_Hidden": false, + "m_Value": 1.0, + "m_FloatType": 0, + "m_RangeValues": { + "x": 0.0, + "y": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "6f81c54afedb4121beec4c5dd20d49ca", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 2, + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalUnlitSubTarget", + "m_ObjectId": "70aa7d9924f34d9783d1596af7adea92" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "9de2ad20c59b4cfd8502617f7c9048e9", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": { + "e00": 0.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 0.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 0.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 0.0 + }, + "m_DefaultValue": { + "e00": 1.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 1.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 1.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot", + "m_ObjectId": "a7f687bea27a4db6938bd312e2d62b85", + "m_Id": 0, + "m_DisplayName": "Position", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Position", + "m_StageCapability": 1, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_Space": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "ace6a9b2694a4b959bdb23fd2b380e09", + "m_Group": { + "m_Id": "" + }, + "m_Name": "VertexDescription.Tangent", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "220842e9adab449186142f4787f3bf02" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Tangent" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "b441cb7e0f6c4cccabafce30db4c60f7", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "e00": 2.0, + "e01": 2.0, + "e02": 2.0, + "e03": 2.0, + "e10": 2.0, + "e11": 2.0, + "e12": 2.0, + "e13": 2.0, + "e20": 2.0, + "e21": 2.0, + "e22": 2.0, + "e23": 2.0, + "e30": 2.0, + "e31": 2.0, + "e32": 2.0, + "e33": 2.0 + }, + "m_DefaultValue": { + "e00": 1.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 1.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 1.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CategoryData", + "m_ObjectId": "bcc1343d7ba641c4826c159bbc4864eb", + "m_Name": "", + "m_ChildObjectList": [ + { + "m_Id": "6f27c2c9fd1443c89632fdf7c8711e20" + }, + { + "m_Id": "fdf3d3e255ae4183a5553726645af92a" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "cc8de72b4f02452f819aaf9288f8f813", + "m_Id": 2, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "e00": 0.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 0.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 0.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 0.0 + }, + "m_DefaultValue": { + "e00": 1.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 1.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 1.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "cd92e567b4ea4279b6e48695f6d1cc48", + "m_Id": 0, + "m_DisplayName": "OutlineColor", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "d58d86e00fe54878b34c9c377b041111", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -243.99998474121095, + "y": 239.00001525878907, + "width": 142.0, + "height": 33.99998474121094 + } + }, + "m_Slots": [ + { + "m_Id": "cd92e567b4ea4279b6e48695f6d1cc48" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "fdf3d3e255ae4183a5553726645af92a" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", + "m_ObjectId": "d738eb35648f42d6a6b91d933e1e1c51", + "m_Id": 0, + "m_DisplayName": "Normal", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Normal", + "m_StageCapability": 1, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_Space": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "dca90633999b48bdb2056aa84a63fd13", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -529.0, + "y": 148.00001525878907, + "width": 170.0, + "height": 34.0 + } + }, + "m_Slots": [ + { + "m_Id": "3ebc23d58f384cdcb210ee6ea155bc9a" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "6f27c2c9fd1443c89632fdf7c8711e20" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot", + "m_ObjectId": "de34186f3b28434a8067a00526f2e9cc", + "m_Id": 0, + "m_DisplayName": "Base Color", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "BaseColor", + "m_StageCapability": 2, + "m_Value": { + "x": 0.5, + "y": 0.5, + "z": 0.5 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_ColorMode": 0, + "m_DefaultColor": { + "r": 0.5, + "g": 0.5, + "b": 0.5, + "a": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "f135575968df4de086c6b2a09c78c42a", + "m_Group": { + "m_Id": "" + }, + "m_Name": "VertexDescription.Normal", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "d738eb35648f42d6a6b91d933e1e1c51" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Normal" +} + +{ + "m_SGVersion": 3, + "m_Type": "UnityEditor.ShaderGraph.Internal.ColorShaderProperty", + "m_ObjectId": "fdf3d3e255ae4183a5553726645af92a", + "m_Guid": { + "m_GuidSerialized": "a7f299cc-05f3-46d9-bb90-4d2f7f9c556e" + }, + "m_Name": "OutlineColor", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "OutlineColor", + "m_DefaultReferenceName": "_OutlineColor", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_DismissedVersion": 0, + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 3, + "m_Hidden": false, + "m_Value": { + "r": 0.0, + "g": 0.0, + "b": 0.0, + "a": 0.0 + }, + "isMainColor": false, + "m_ColorMode": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "ff4d67c3ac5b4481b9ec3ee425bbe04b", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.BaseColor", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "de34186f3b28434a8067a00526f2e9cc" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.BaseColor" +} + diff --git a/Assets/Shaders/RotateAnchorShader.shadergraph.meta b/Assets/Shaders/RotateAnchorShader.shadergraph.meta new file mode 100644 index 0000000..6ed111c --- /dev/null +++ b/Assets/Shaders/RotateAnchorShader.shadergraph.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: c2e150b7ef7e5614eabcd8158db173ef +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} diff --git a/Assets/VRTemplateAssets/Materials/Pointer/Pointer Outline.mat b/Assets/VRTemplateAssets/Materials/Pointer/Pointer Outline.mat index 9665cc0..8e5a720 100644 --- a/Assets/VRTemplateAssets/Materials/Pointer/Pointer Outline.mat +++ b/Assets/VRTemplateAssets/Materials/Pointer/Pointer Outline.mat @@ -2,20 +2,27 @@ %TAG !u! tag:unity3d.com,2011: --- !u!21 &2100000 Material: - serializedVersion: 6 + serializedVersion: 8 m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: Pointer Outline m_Shader: {fileID: 4800000, guid: 5e723135b0fd1e34ba403dc074c61877, type: 3} - m_ShaderKeywords: _ALPHAPREMULTIPLY_ON _EMISSION _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: + - _ALPHAPREMULTIPLY_ON + - _EMISSION + - _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A m_LightmapFlags: 2 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 stringTagMap: {} disabledShaderPasses: [] + m_LockedProperties: m_SavedProperties: serializedVersion: 3 m_TexEnvs: @@ -80,8 +87,8 @@ Material: - _UVSec: 0 - _ZWrite: 0 m_Colors: - - _Color: {r: 0.504, g: 0.504, b: 0.504, a: 0.2} - - _EdgeColor: {r: 1, g: 1, b: 1, a: 0.9019608} + - _Color: {r: 0.254717, g: 0.116545044, b: 0.116545044, a: 0.2} + - _EdgeColor: {r: 0.56287825, g: 0.76030153, b: 0.8584906, a: 0.9019608} - _EdgeData: {r: -0.12, g: 0.88, b: 0.74, a: 1.5} - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} m_BuildTextureStacks: [] -- GitLab