Add rotate speech command

This commit is contained in:
Santiago Lo Coco 2024-11-07 23:21:08 +01:00
parent f6acdb6852
commit 333076dc15
3 changed files with 53 additions and 0 deletions

View File

@ -58,3 +58,17 @@ MonoBehaviour:
id: 0
description: None
axisConstraint: 0
- localizationKey:
keyword: Rotate
keyCode: 273
action:
id: 0
description: None
axisConstraint: 0
- localizationKey:
keyword: Unfollow
keyCode: 0
action:
id: 0
description: None
axisConstraint: 0

View File

@ -7653,6 +7653,34 @@ MonoBehaviour:
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
- keyword: Rotate
response:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1193822414}
m_TargetAssemblyTypeName: ConfigureOrbital, Assembly-CSharp
m_MethodName: RotateCanvasToFaceUser
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
- m_Target: {fileID: 2018722013}
m_TargetAssemblyTypeName: UnityEngine.AudioSource, UnityEngine
m_MethodName: PlayOneShot
m_Mode: 2
m_Arguments:
m_ObjectArgument: {fileID: 8300000, guid: 4075162bd7e8d9b4387ba77aeb751a0d, type: 3}
m_ObjectArgumentAssemblyTypeName: UnityEngine.AudioClip, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
persistentKeywords: 0
speechConfirmationTooltipPrefab: {fileID: 8046114618238072051, guid: 271778f6c957b524981067a81d238394, type: 3}
--- !u!82 &2018722013

View File

@ -44,4 +44,15 @@ public class ConfigureOrbital : MonoBehaviour
}
}
}
public void RotateCanvasToFaceUser()
{
List<GameObject> canvases = endpointLoader.GetInstantiatedItems();
foreach (GameObject canvas in canvases)
{
Vector3 directionToCamera = canvas.transform.position - Camera.main.transform.position;
canvas.transform.rotation = Quaternion.LookRotation(directionToCamera);
}
}
}