game: npcs can be more than one
This commit is contained in:
parent
7d1c308e34
commit
52d2a0c373
2 changed files with 30 additions and 34 deletions
|
@ -2237,7 +2237,7 @@ MonoBehaviour:
|
||||||
m_fontSizeBase: 60.45
|
m_fontSizeBase: 60.45
|
||||||
m_fontWeight: 400
|
m_fontWeight: 400
|
||||||
m_enableAutoSizing: 1
|
m_enableAutoSizing: 1
|
||||||
m_fontSizeMin: 40
|
m_fontSizeMin: 20
|
||||||
m_fontSizeMax: 72
|
m_fontSizeMax: 72
|
||||||
m_fontStyle: 0
|
m_fontStyle: 0
|
||||||
m_HorizontalAlignment: 2
|
m_HorizontalAlignment: 2
|
||||||
|
|
|
@ -52,46 +52,42 @@ public class PaperSocket : MonoBehaviour
|
||||||
private void OnPaperAttached(SelectEnterEventArgs args)
|
private void OnPaperAttached(SelectEnterEventArgs args)
|
||||||
{
|
{
|
||||||
GameObject paperObject = args.interactableObject.transform.gameObject;
|
GameObject paperObject = args.interactableObject.transform.gameObject;
|
||||||
string paperName = paperObject.name;
|
|
||||||
|
|
||||||
if (socketName == "Paper Socket_NPC" && paperName == "Spawnable_Doc")
|
if (paperObject.TryGetComponent<StampDocument>(out StampDocument stampDoc))
|
||||||
{
|
{
|
||||||
if (paperName == "Spawnable_Doc")
|
/*StampDocument stampDoc = paperObject.GetComponent<StampDocument>();*/
|
||||||
|
|
||||||
|
if (stampDoc != null)
|
||||||
{
|
{
|
||||||
StampDocument stampDoc = paperObject.GetComponent<StampDocument>();
|
if (stampDoc.isStamped && stampDoc.isSigned)
|
||||||
|
|
||||||
if (stampDoc != null)
|
|
||||||
{
|
{
|
||||||
if (stampDoc.isStamped && stampDoc.isSigned)
|
Debug.Log("Checked Docs");
|
||||||
{
|
PlayerDialogueInteraction.instance.takeDocumentsTick.SetActive(true);
|
||||||
Debug.Log("Checked Docs");
|
PlayerDialogueInteraction.instance.giveDocumentsTick.SetActive(true);
|
||||||
PlayerDialogueInteraction.instance.takeDocumentsTick.SetActive(true);
|
|
||||||
PlayerDialogueInteraction.instance.giveDocumentsTick.SetActive(true);
|
|
||||||
|
|
||||||
var paperDepartment = stampDoc.CheckFinalDepartment();
|
var paperDepartment = stampDoc.CheckFinalDepartment();
|
||||||
Debug.Log(paperDepartment);
|
Debug.Log(paperDepartment);
|
||||||
/*if (paperDepartment == "Correct")
|
/*if (paperDepartment == "Correct")
|
||||||
{
|
|
||||||
Backend.instance.User.customersHelpedCorrectly += 1;
|
|
||||||
Backend.instance.User.score += GameManager.instance.currentNPC.GetComponent<NpcMovementRework>().npcData.points;
|
|
||||||
}
|
|
||||||
else if (paperDepartment == "Wrong")
|
|
||||||
{
|
|
||||||
Backend.instance.User.customersHelpedWrongly += 1;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
Destroy(paperObject);
|
|
||||||
|
|
||||||
GameManager.instance.currentNPC.GetComponent<NpcMovementRework>().EndDialogue();
|
|
||||||
|
|
||||||
GameManager.instance.currentNPC.GetComponent<NpcMovementRework>().Despawn();
|
|
||||||
GameManager.instance.currentNPC = null;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
XRSocketInteractor socket = GetComponent<XRSocketInteractor>();
|
Backend.instance.User.customersHelpedCorrectly += 1;
|
||||||
socket.interactionManager.SelectExit(socket, args.interactableObject);
|
Backend.instance.User.score += GameManager.instance.currentNPC.GetComponent<NpcMovementRework>().npcData.points;
|
||||||
}
|
}
|
||||||
|
else if (paperDepartment == "Wrong")
|
||||||
|
{
|
||||||
|
Backend.instance.User.customersHelpedWrongly += 1;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
Destroy(paperObject);
|
||||||
|
|
||||||
|
GameManager.instance.currentNPC.GetComponent<NpcMovementRework>().EndDialogue();
|
||||||
|
|
||||||
|
GameManager.instance.currentNPC.GetComponent<NpcMovementRework>().Despawn();
|
||||||
|
GameManager.instance.currentNPC = null;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
XRSocketInteractor socket = GetComponent<XRSocketInteractor>();
|
||||||
|
socket.interactionManager.SelectExit(socket, args.interactableObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue