game: stamps and signatures work

This commit is contained in:
kookiekenobi 2025-02-17 22:14:02 +08:00
parent 3983bd6e9e
commit 9d1b9f5872
5 changed files with 75 additions and 86 deletions

View file

@ -2500,12 +2500,6 @@ MonoBehaviour:
serviceTick: {fileID: 972086447}
takeDocumentsTick: {fileID: 675043657}
giveDocumentsTick: {fileID: 201719675}
comcareServiceButton: {fileID: 2143047714}
fscServiceButton: {fileID: 1137450851}
peersServiceButton: {fileID: 405944146}
transitionalSheltersServiceButton: {fileID: 144678493}
cpsServiceButton: {fileID: 1270430611}
sgEnableServiceButton: {fileID: 783080947}
currentDocument: {fileID: 0}
--- !u!1 &278641001
GameObject:
@ -6150,63 +6144,6 @@ MonoBehaviour:
m_OnKeyboardFocusChanged:
m_PersistentCalls:
m_Calls: []
--- !u!1001 &669125608
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 7579783095933529078, guid: bc7aab643b4d1ae4cadc4b6abba2b349, type: 3}
propertyPath: m_Name
value: Stamp_Diabilities
objectReference: {fileID: 0}
- target: {fileID: 7591921673328099837, guid: bc7aab643b4d1ae4cadc4b6abba2b349, type: 3}
propertyPath: m_LocalPosition.x
value: 0.5992
objectReference: {fileID: 0}
- target: {fileID: 7591921673328099837, guid: bc7aab643b4d1ae4cadc4b6abba2b349, type: 3}
propertyPath: m_LocalPosition.y
value: 0.8763829
objectReference: {fileID: 0}
- target: {fileID: 7591921673328099837, guid: bc7aab643b4d1ae4cadc4b6abba2b349, type: 3}
propertyPath: m_LocalPosition.z
value: 1.1857
objectReference: {fileID: 0}
- target: {fileID: 7591921673328099837, guid: bc7aab643b4d1ae4cadc4b6abba2b349, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7591921673328099837, guid: bc7aab643b4d1ae4cadc4b6abba2b349, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7591921673328099837, guid: bc7aab643b4d1ae4cadc4b6abba2b349, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 7591921673328099837, guid: bc7aab643b4d1ae4cadc4b6abba2b349, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 7591921673328099837, guid: bc7aab643b4d1ae4cadc4b6abba2b349, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7591921673328099837, guid: bc7aab643b4d1ae4cadc4b6abba2b349, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7591921673328099837, guid: bc7aab643b4d1ae4cadc4b6abba2b349, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: bc7aab643b4d1ae4cadc4b6abba2b349, type: 3}
--- !u!1 &675043657 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 4601194076290656434, guid: 7795d1095e0684f468f5b8231bb7705f, type: 3}
@ -15212,6 +15149,63 @@ Transform:
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1468703799
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 7579783095933529078, guid: bc7aab643b4d1ae4cadc4b6abba2b349, type: 3}
propertyPath: m_Name
value: Stamp_Disabilities
objectReference: {fileID: 0}
- target: {fileID: 7591921673328099837, guid: bc7aab643b4d1ae4cadc4b6abba2b349, type: 3}
propertyPath: m_LocalPosition.x
value: 0.5992
objectReference: {fileID: 0}
- target: {fileID: 7591921673328099837, guid: bc7aab643b4d1ae4cadc4b6abba2b349, type: 3}
propertyPath: m_LocalPosition.y
value: 0.8763829
objectReference: {fileID: 0}
- target: {fileID: 7591921673328099837, guid: bc7aab643b4d1ae4cadc4b6abba2b349, type: 3}
propertyPath: m_LocalPosition.z
value: 1.1857
objectReference: {fileID: 0}
- target: {fileID: 7591921673328099837, guid: bc7aab643b4d1ae4cadc4b6abba2b349, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7591921673328099837, guid: bc7aab643b4d1ae4cadc4b6abba2b349, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7591921673328099837, guid: bc7aab643b4d1ae4cadc4b6abba2b349, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 7591921673328099837, guid: bc7aab643b4d1ae4cadc4b6abba2b349, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 7591921673328099837, guid: bc7aab643b4d1ae4cadc4b6abba2b349, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7591921673328099837, guid: bc7aab643b4d1ae4cadc4b6abba2b349, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7591921673328099837, guid: bc7aab643b4d1ae4cadc4b6abba2b349, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: bc7aab643b4d1ae4cadc4b6abba2b349, type: 3}
--- !u!1 &1479080137
GameObject:
m_ObjectHideFlags: 0
@ -21352,4 +21346,4 @@ SceneRoots:
- {fileID: 1339160292}
- {fileID: 1399971910}
- {fileID: 43707400}
- {fileID: 669125608}
- {fileID: 1468703799}

View file

@ -64,14 +64,16 @@ public class PaperSocket : MonoBehaviour
{
if (stampDoc.isStamped && stampDoc.isSigned)
{
Debug.Log("Document given");
PlayerDialogueInteraction.instance.takeDocumentsTick.SetActive(true);
PlayerDialogueInteraction.instance.giveDocumentsTick.SetActive(true);
var paperDepartment = stampDoc.CheckFinalDepartment();
Debug.Log(paperDepartment);
Destroy(paperObject);
}
else
{
Debug.Log("Either not stamped or not signed");
XRSocketInteractor socket = GetComponent<XRSocketInteractor>();
socket.interactionManager.SelectExit(socket, args.interactableObject);
}

View file

@ -32,6 +32,8 @@ public class PenInteractor : MonoBehaviour
if(stampDocScript != null)
{
PlayerDialogueInteraction.instance.currentDocument = stampDocScript.gameObject;
if(!stampDocScript.isSigned)
{
PlayerDialogueInteraction.instance.servicesPanel.SetActive(true);

View file

@ -205,9 +205,16 @@ public class PlayerDialogueInteraction : MonoBehaviour
/// <param name="service"></param>
public void OnServiceSelected(string service)
{
servicesPanel.SetActive(false);
questionPanel.SetActive(true);
if (currentDocument != null)
{
servicesPanel.SetActive(false);
questionPanel.SetActive(true);
currentDocument.GetComponent<StampDocument>().Sign(service);
currentDocument.GetComponent<StampDocument>().Sign(service);
}
else
{
Debug.LogError("currentDocument is null");
}
}
}

View file

@ -40,7 +40,7 @@ public class StampDocument : MonoBehaviour
/// See finalised document detail
/// </summary>
/// <returns></returns>
private string CheckFinalDepartment()
public string CheckFinalDepartment()
{
return $"{assignedDepartment}-{assignedService}";
}
@ -160,20 +160,4 @@ public class StampDocument : MonoBehaviour
}
}
/// <summary>
/// Declares this is current document
/// </summary>
/// <param name="other"></param>
private void OnColliderEnter(Collider collision)
{
if (collision.gameObject.CompareTag("Pen"))
{
/*
PlayerDialogueInteraction.instance.servicesPanel.SetActive(true);
*/
PlayerDialogueInteraction.instance.currentDocument = gameObject;
}
}
}