Optimized Oribit Camera in Replay, now only moving with right click
This commit is contained in:
@@ -16,7 +16,8 @@ MonoBehaviour:
|
|||||||
keys:
|
keys:
|
||||||
- Meta.XR.SDK.UsageSettings.UsesProjectSetupTool
|
- Meta.XR.SDK.UsageSettings.UsesProjectSetupTool
|
||||||
- Meta.XR.SDK.UsageSettings.UsesBuildingBlocks
|
- Meta.XR.SDK.UsageSettings.UsesBuildingBlocks
|
||||||
values: 0101
|
- Meta.XR.SDK.UsageSettings.UsesXRSimulator
|
||||||
|
values: 010101
|
||||||
intProperties:
|
intProperties:
|
||||||
keys: []
|
keys: []
|
||||||
values:
|
values:
|
||||||
|
|||||||
@@ -732,7 +732,7 @@ MonoBehaviour:
|
|||||||
m_StreamingVersion: 20241001
|
m_StreamingVersion: 20241001
|
||||||
m_LegacyPriority: 0
|
m_LegacyPriority: 0
|
||||||
Target:
|
Target:
|
||||||
TrackingTarget: {fileID: 6913818243333983922}
|
TrackingTarget: {fileID: 127221674}
|
||||||
LookAtTarget: {fileID: 0}
|
LookAtTarget: {fileID: 0}
|
||||||
CustomLookAtTarget: 0
|
CustomLookAtTarget: 0
|
||||||
Lens:
|
Lens:
|
||||||
@@ -3070,7 +3070,7 @@ MonoBehaviour:
|
|||||||
m_StreamingVersion: 20241001
|
m_StreamingVersion: 20241001
|
||||||
m_LegacyPriority: 0
|
m_LegacyPriority: 0
|
||||||
Target:
|
Target:
|
||||||
TrackingTarget: {fileID: 6913818243333983922}
|
TrackingTarget: {fileID: 1163434184}
|
||||||
LookAtTarget: {fileID: 0}
|
LookAtTarget: {fileID: 0}
|
||||||
CustomLookAtTarget: 0
|
CustomLookAtTarget: 0
|
||||||
Lens:
|
Lens:
|
||||||
@@ -3620,6 +3620,7 @@ GameObject:
|
|||||||
- component: {fileID: 737210445}
|
- component: {fileID: 737210445}
|
||||||
- component: {fileID: 737210444}
|
- component: {fileID: 737210444}
|
||||||
- component: {fileID: 737210443}
|
- component: {fileID: 737210443}
|
||||||
|
- component: {fileID: 737210448}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: OrbitCam
|
m_Name: OrbitCam
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
@@ -3658,7 +3659,7 @@ MonoBehaviour:
|
|||||||
DecelTime: 0.2
|
DecelTime: 0.2
|
||||||
- Name: Look Orbit Y
|
- Name: Look Orbit Y
|
||||||
Owner: {fileID: 737210445}
|
Owner: {fileID: 737210445}
|
||||||
Enabled: 1
|
Enabled: 0
|
||||||
Input:
|
Input:
|
||||||
InputAction: {fileID: -5630151704836100654, guid: 1d6e640e716dc4ff6989b73d02023f2b,
|
InputAction: {fileID: -5630151704836100654, guid: 1d6e640e716dc4ff6989b73d02023f2b,
|
||||||
type: 3}
|
type: 3}
|
||||||
@@ -3755,9 +3756,9 @@ MonoBehaviour:
|
|||||||
Time: 2
|
Time: 2
|
||||||
Restrictions: 0
|
Restrictions: 0
|
||||||
VerticalAxis:
|
VerticalAxis:
|
||||||
Value: 17.5
|
Value: 30
|
||||||
Center: 17.5
|
Center: 30
|
||||||
Range: {x: -10, y: 45}
|
Range: {x: -10, y: 60}
|
||||||
Wrap: 0
|
Wrap: 0
|
||||||
Recentering:
|
Recentering:
|
||||||
Enabled: 0
|
Enabled: 0
|
||||||
@@ -3765,9 +3766,9 @@ MonoBehaviour:
|
|||||||
Time: 2
|
Time: 2
|
||||||
Restrictions: 0
|
Restrictions: 0
|
||||||
RadialAxis:
|
RadialAxis:
|
||||||
Value: 1
|
Value: 0.1
|
||||||
Center: 1
|
Center: 0.1
|
||||||
Range: {x: 1, y: 1}
|
Range: {x: 0.1, y: 1}
|
||||||
Wrap: 0
|
Wrap: 0
|
||||||
Recentering:
|
Recentering:
|
||||||
Enabled: 0
|
Enabled: 0
|
||||||
@@ -3794,7 +3795,7 @@ MonoBehaviour:
|
|||||||
m_StreamingVersion: 20241001
|
m_StreamingVersion: 20241001
|
||||||
m_LegacyPriority: 0
|
m_LegacyPriority: 0
|
||||||
Target:
|
Target:
|
||||||
TrackingTarget: {fileID: 6913818243333983922}
|
TrackingTarget: {fileID: 1163434184}
|
||||||
LookAtTarget: {fileID: 0}
|
LookAtTarget: {fileID: 0}
|
||||||
CustomLookAtTarget: 0
|
CustomLookAtTarget: 0
|
||||||
Lens:
|
Lens:
|
||||||
@@ -3825,13 +3826,28 @@ Transform:
|
|||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 737210442}
|
m_GameObject: {fileID: 737210442}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_LocalRotation: {x: 0.1521234, y: 0.0000000041576134, z: -6.3991795e-10, w: 0.98836154}
|
m_LocalRotation: {x: 0.25881907, y: 5.2428895e-23, z: -1.3116896e-23, w: 0.9659259}
|
||||||
m_LocalPosition: {x: 0, y: 3.0070581, z: -9.537169}
|
m_LocalPosition: {x: 0, y: 0.5, z: -0.8660254}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!114 &737210448
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 737210442}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 77bfd51a51660c04b8c06ccb69c96587, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
aimAction: {fileID: -1608118824973676762, guid: 1d6e640e716dc4ff6989b73d02023f2b,
|
||||||
|
type: 3}
|
||||||
|
inputAxisController: {fileID: 737210443}
|
||||||
--- !u!1 &742612850
|
--- !u!1 &742612850
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.InputSystem;
|
||||||
|
using Unity.Cinemachine;
|
||||||
|
|
||||||
|
public class OrbitCameraMouseControl : MonoBehaviour
|
||||||
|
{
|
||||||
|
[Header("Input Actions")]
|
||||||
|
public InputActionReference aimAction; // CM Default / Aim
|
||||||
|
|
||||||
|
[Header("Cinemachine Components")]
|
||||||
|
public CinemachineInputAxisController inputAxisController;
|
||||||
|
|
||||||
|
private void OnEnable()
|
||||||
|
{
|
||||||
|
if (aimAction != null)
|
||||||
|
aimAction.action.Enable();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnDisable()
|
||||||
|
{
|
||||||
|
if (aimAction != null)
|
||||||
|
aimAction.action.Disable();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
bool isAiming = aimAction != null && aimAction.action.ReadValue<float>() > 0.5f;
|
||||||
|
|
||||||
|
if (inputAxisController != null)
|
||||||
|
{
|
||||||
|
inputAxisController.Controllers[0].Enabled = isAiming;
|
||||||
|
inputAxisController.Controllers[1].Enabled = isAiming;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 77bfd51a51660c04b8c06ccb69c96587
|
||||||
Reference in New Issue
Block a user