diff --git a/Assets/Scenes/Version2.unity b/Assets/Scenes/Version2.unity index 8f5f5c7..4970c1a 100644 --- a/Assets/Scenes/Version2.unity +++ b/Assets/Scenes/Version2.unity @@ -1452,7 +1452,7 @@ RectTransform: - {fileID: 1946133108} - {fileID: 844924682} m_Father: {fileID: 1704906816} - m_RootOrder: 19 + m_RootOrder: 17 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} @@ -4339,7 +4339,7 @@ RectTransform: - {fileID: 2094428666} - {fileID: 18660879} m_Father: {fileID: 1704906816} - m_RootOrder: 21 + m_RootOrder: 19 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} @@ -6044,7 +6044,7 @@ RectTransform: - {fileID: 292348636} - {fileID: 994851659} m_Father: {fileID: 1704906816} - m_RootOrder: 9 + m_RootOrder: 7 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} @@ -8619,7 +8619,6 @@ GameObject: m_Component: - component: {fileID: 482905334} - component: {fileID: 482905336} - - component: {fileID: 482905335} m_Layer: 5 m_Name: DynamicBone m_TagString: Untagged @@ -8639,44 +8638,14 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 845364685} - m_Father: {fileID: 1704906816} - m_RootOrder: 4 + m_Father: {fileID: 548276324} + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 50} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 283, y: -75} + m_SizeDelta: {x: 283, y: 50} m_Pivot: {x: 1, y: 0.5} ---- !u!114 &482905335 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 482905333} - 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: 0, g: 0, b: 0, a: 0.19607843} - 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: 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!222 &482905336 CanvasRenderer: m_ObjectHideFlags: 0 @@ -10094,6 +10063,84 @@ MonoBehaviour: m_EditorClassIdentifier: m_Padding: {x: -8, y: -5, z: -8, w: -5} m_Softness: {x: 0, y: 0} +--- !u!1 &548276323 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 548276324} + - component: {fileID: 548276326} + - component: {fileID: 548276325} + m_Layer: 5 + m_Name: ModelSettings + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &548276324 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 548276323} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1798338064} + - {fileID: 482905334} + - {fileID: 1333306137} + m_Father: {fileID: 1704906816} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 200} + m_Pivot: {x: 1, y: 0.5} +--- !u!114 &548276325 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 548276323} + 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: 0, g: 0, b: 0, a: 0.19607843} + 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: 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!222 &548276326 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 548276323} + m_CullTransparentMesh: 1 --- !u!1 &548963527 GameObject: m_ObjectHideFlags: 0 @@ -11005,7 +11052,7 @@ RectTransform: m_Children: - {fileID: 1400934330} m_Father: {fileID: 1704906816} - m_RootOrder: 10 + m_RootOrder: 8 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -13182,7 +13229,7 @@ RectTransform: m_Children: - {fileID: 1887819554} m_Father: {fileID: 1704906816} - m_RootOrder: 13 + m_RootOrder: 11 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} @@ -14849,7 +14896,7 @@ RectTransform: m_Children: - {fileID: 1323454211} m_Father: {fileID: 1704906816} - m_RootOrder: 22 + m_RootOrder: 20 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -16203,7 +16250,7 @@ RectTransform: m_Children: - {fileID: 992041010} m_Father: {fileID: 1704906816} - m_RootOrder: 6 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -18413,7 +18460,7 @@ MonoBehaviour: m_MethodName: ToggleUIPanel m_Mode: 2 m_Arguments: - m_ObjectArgument: {fileID: 1798338063} + m_ObjectArgument: {fileID: 548276323} m_ObjectArgumentAssemblyTypeName: UnityEngine.GameObject, UnityEngine m_IntArgument: 0 m_FloatArgument: 0 @@ -19172,7 +19219,7 @@ RectTransform: m_Children: - {fileID: 1296918362} m_Father: {fileID: 1704906816} - m_RootOrder: 18 + m_RootOrder: 16 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -20415,7 +20462,7 @@ MonoBehaviour: m_HandleRect: {fileID: 1882365342} m_Direction: 2 m_Value: 1 - m_Size: 0.9254385 + m_Size: 0.88527817 m_NumberOfSteps: 0 m_OnValueChanged: m_PersistentCalls: @@ -20490,7 +20537,7 @@ RectTransform: m_Children: - {fileID: 494042607} m_Father: {fileID: 1704906816} - m_RootOrder: 16 + m_RootOrder: 14 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -20835,7 +20882,7 @@ RectTransform: - {fileID: 916764976} - {fileID: 1385563000} m_Father: {fileID: 1704906816} - m_RootOrder: 7 + m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} @@ -22714,7 +22761,6 @@ GameObject: m_Component: - component: {fileID: 1333306137} - component: {fileID: 1333306139} - - component: {fileID: 1333306138} m_Layer: 5 m_Name: EarMoprh m_TagString: Untagged @@ -22734,44 +22780,14 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 1252885464} - m_Father: {fileID: 1704906816} - m_RootOrder: 5 + m_Father: {fileID: 548276324} + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 50} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 283, y: -125} + m_SizeDelta: {x: 283, y: 50} m_Pivot: {x: 1, y: 0.5} ---- !u!114 &1333306138 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1333306136} - 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: 0, g: 0, b: 0, a: 0.19607843} - 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: 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!222 &1333306139 CanvasRenderer: m_ObjectHideFlags: 0 @@ -22850,7 +22866,7 @@ RectTransform: m_Children: - {fileID: 1104495875} m_Father: {fileID: 1704906816} - m_RootOrder: 14 + m_RootOrder: 12 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -23307,7 +23323,7 @@ RectTransform: - {fileID: 1590756440} - {fileID: 1862189160} m_Father: {fileID: 1704906816} - m_RootOrder: 23 + m_RootOrder: 21 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} @@ -24555,7 +24571,7 @@ RectTransform: m_Children: - {fileID: 787741672} m_Father: {fileID: 1704906816} - m_RootOrder: 20 + m_RootOrder: 18 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -28032,7 +28048,7 @@ RectTransform: m_Children: - {fileID: 2016037558} m_Father: {fileID: 1704906816} - m_RootOrder: 12 + m_RootOrder: 10 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -29022,9 +29038,7 @@ RectTransform: - {fileID: 991136000} - {fileID: 6878219666121841224} - {fileID: 1046617015} - - {fileID: 1798338064} - - {fileID: 482905334} - - {fileID: 1333306137} + - {fileID: 548276324} - {fileID: 893956225} - {fileID: 1209823365} - {fileID: 2091332066} @@ -29123,7 +29137,7 @@ RectTransform: - {fileID: 1408642259} - {fileID: 1525688469} m_Father: {fileID: 1704906816} - m_RootOrder: 11 + m_RootOrder: 9 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} @@ -30312,7 +30326,6 @@ GameObject: m_Component: - component: {fileID: 1798338064} - component: {fileID: 1798338066} - - component: {fileID: 1798338065} m_Layer: 5 m_Name: LockChara m_TagString: Untagged @@ -30332,44 +30345,14 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 1364855926} - m_Father: {fileID: 1704906816} - m_RootOrder: 3 + m_Father: {fileID: 548276324} + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 50} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 283, y: -25} + m_SizeDelta: {x: 283, y: 50} m_Pivot: {x: 1, y: 0.5} ---- !u!114 &1798338065 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1798338063} - 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: 0, g: 0, b: 0, a: 0.19607843} - 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: 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!222 &1798338066 CanvasRenderer: m_ObjectHideFlags: 0 @@ -34210,7 +34193,7 @@ RectTransform: m_Children: - {fileID: 1139092354} m_Father: {fileID: 1704906816} - m_RootOrder: 8 + m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -35277,7 +35260,7 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 1704906816} - m_RootOrder: 17 + m_RootOrder: 15 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} @@ -35527,7 +35510,7 @@ RectTransform: - {fileID: 542685196} - {fileID: 964213176} m_Father: {fileID: 1704906816} - m_RootOrder: 15 + m_RootOrder: 13 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} @@ -35857,9 +35840,9 @@ RectTransform: m_Father: {fileID: 6878219667498913896} m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 106.5, y: -286} m_SizeDelta: {x: 180, y: 20} m_Pivot: {x: 0.5, y: 1} --- !u!114 &6878219665895574065 @@ -36365,9 +36348,9 @@ RectTransform: m_Father: {fileID: 6878219667498913896} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 106.5, y: -57.2} m_SizeDelta: {x: 180, y: 20} m_Pivot: {x: 0.5, y: 1} --- !u!114 &6878219666109573094 @@ -38722,9 +38705,9 @@ RectTransform: m_Father: {fileID: 6878219667498913896} m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 106.5, y: -171.6} m_SizeDelta: {x: 180, y: 20} m_Pivot: {x: 0.5, y: 1} --- !u!114 &6878219666841734894 @@ -39553,9 +39536,9 @@ RectTransform: m_Father: {fileID: 6878219667498913896} m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 106.5, y: -228.8} m_SizeDelta: {x: 180, y: 20} m_Pivot: {x: 0.5, y: 1} --- !u!114 &6878219667203546886 @@ -41265,9 +41248,9 @@ RectTransform: m_Father: {fileID: 6878219667498913896} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 106.5, y: 0} m_SizeDelta: {x: 180, y: 20} m_Pivot: {x: 0.5, y: 1} --- !u!114 &6878219667749320559 @@ -41485,9 +41468,9 @@ RectTransform: m_Father: {fileID: 6878219667498913896} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 106.5, y: -114.4} m_SizeDelta: {x: 180, y: 20} m_Pivot: {x: 0.5, y: 1} --- !u!1 &6878219667784581358 diff --git a/Assets/Scripts/UmaContainer.cs b/Assets/Scripts/UmaContainer.cs index 3f92981..f9848b4 100644 --- a/Assets/Scripts/UmaContainer.cs +++ b/Assets/Scripts/UmaContainer.cs @@ -27,6 +27,7 @@ public class UmaContainer : MonoBehaviour public GameObject HeadBone; public GameObject TrackTarget; public float EyeHeight; + public bool EnableEyeTracking = true; [Header("Generic")] public bool IsGeneric = false; @@ -135,12 +136,15 @@ public class UmaContainer : MonoBehaviour private void FixedUpdate() { - if (TrackTarget&&!isAnimatorControl&&!IsMini) + if (TrackTarget&& EnableEyeTracking && !IsMini) { var targetPosotion = TrackTarget.transform.position - HeadBone.transform.up*EyeHeight; var deltaPos = HeadBone.transform.InverseTransformPoint(targetPosotion); - var deltaRotation = HeadBone.transform.InverseTransformDirection(deltaPos.normalized); - var finalRotation = new Vector2(Mathf.Clamp(deltaRotation.x / 0.86f,-1,1), Mathf.Clamp(deltaRotation.y / 0.66f, -1, 1));//Limited to the angle of view + var deltaRotation = Quaternion.LookRotation(deltaPos.normalized, HeadBone.transform.up).eulerAngles; + if (deltaRotation.x > 180) deltaRotation.x -= 360; + if (deltaRotation.y > 180) deltaRotation.y -= 360; + + var finalRotation = new Vector2(Mathf.Clamp(deltaRotation.y / 35,-1,1), Mathf.Clamp(-deltaRotation.x / 25, -1, 1));//Limited to the angle of view FaceDrivenKeyTarget.SetEyeRange(finalRotation.x, finalRotation.y, finalRotation.x, -finalRotation.y); } diff --git a/Assets/Scripts/UmaViewerBuilder.cs b/Assets/Scripts/UmaViewerBuilder.cs index f58d86e..1c2ab1f 100644 --- a/Assets/Scripts/UmaViewerBuilder.cs +++ b/Assets/Scripts/UmaViewerBuilder.cs @@ -960,6 +960,7 @@ public class UmaViewerBuilder : MonoBehaviour CurrentUMAContainer.UmaAnimator.SetTrigger(needTransit ? "next_s" : "next"); CurrentUMAContainer.isAnimatorControl = false; + CurrentUMAContainer.TrackTarget = Camera.main.gameObject; } else if (clip.name.Contains("face")) { @@ -1004,6 +1005,7 @@ public class UmaViewerBuilder : MonoBehaviour } CurrentUMAContainer.UmaAnimator.Play("motion_2", 0, 0); CurrentUMAContainer.OverrideController["clip_2"].wrapMode = WrapMode.Loop; + CurrentUMAContainer.TrackTarget = PreviewCamera.gameObject; } else { @@ -1012,6 +1014,7 @@ public class UmaViewerBuilder : MonoBehaviour CurrentUMAContainer.FaceDrivenKeyTarget.ResetLocator(); } CurrentUMAContainer.isAnimatorControl = false; + CurrentUMAContainer.TrackTarget = Camera.main.gameObject; SetPreviewCamera(null); CurrentUMAContainer.UmaAnimator.Play("motion_1", 0, lastTime); diff --git a/Assets/Scripts/UmaViewerUI.cs b/Assets/Scripts/UmaViewerUI.cs index 24bdf34..63f5e74 100644 --- a/Assets/Scripts/UmaViewerUI.cs +++ b/Assets/Scripts/UmaViewerUI.cs @@ -624,6 +624,14 @@ public class UmaViewerUI : MonoBehaviour } } + public void SetEyeTrackingEnable(bool isOn) + { + if (Builder.CurrentUMAContainer) + { + Builder.CurrentUMAContainer.EnableEyeTracking = isOn; + } + } + public void ClearCache() { PlayerPrefs.DeleteAll(); diff --git a/Assets/Scripts/umamusume/Gallop/FaceDrivenKeyTarget.cs b/Assets/Scripts/umamusume/Gallop/FaceDrivenKeyTarget.cs index 3d33583..a5baa8d 100644 --- a/Assets/Scripts/umamusume/Gallop/FaceDrivenKeyTarget.cs +++ b/Assets/Scripts/umamusume/Gallop/FaceDrivenKeyTarget.cs @@ -305,7 +305,17 @@ namespace Gallop }); EyeMorphs.ForEach(morph => { - morph.weight = morph.locator.transform.localPosition.x * -100; + if (morph == LeftEyeXrange || morph == LeftEyeYrange || morph == RightEyeXrange || morph == RightEyeYrange) + { + if (!Container.EnableEyeTracking) + { + morph.weight = morph.locator.transform.localPosition.x * -100; + } + } + else + { + morph.weight = morph.locator.transform.localPosition.x * -100; + } }); MouthMorphs.ForEach(morph => {