Compare commits
2 commits
5b5e16d4db
...
bdd216a46d
Author | SHA1 | Date | |
---|---|---|---|
bdd216a46d | |||
ddd3e4be82 |
6 changed files with 51 additions and 29 deletions
|
@ -4634,7 +4634,6 @@ MonoBehaviour:
|
|||
dayEnded: 0
|
||||
shiftStarted: 0
|
||||
currentNPC: {fileID: 0}
|
||||
currentStampDoc: {fileID: 0}
|
||||
frontWalkPoints:
|
||||
- {fileID: 1521924626}
|
||||
- {fileID: 2036976913}
|
||||
|
@ -13748,7 +13747,7 @@ GameObject:
|
|||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!114 &1627151198
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -16946,7 +16945,7 @@ GameObject:
|
|||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!114 &2043314902
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
|
@ -23,7 +23,6 @@ public class GameManager : MonoBehaviour
|
|||
public bool shiftStarted;
|
||||
|
||||
public GameObject currentNPC;
|
||||
public GameObject currentStampDoc;
|
||||
|
||||
[Header("Walk Points (FOR DEBUGGING")]
|
||||
public Transform[] frontWalkPoints;
|
||||
|
|
|
@ -25,7 +25,4 @@ public class NpcData
|
|||
public int points;
|
||||
public bool hasPaper;
|
||||
public string correctDepartment;
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -12,13 +12,7 @@ using UnityEngine.XR.Interaction.Toolkit;
|
|||
using UnityEngine.XR.Interaction.Toolkit.Interactors;
|
||||
public class PenInteractor : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private GameObject stampDoc;
|
||||
private StampDocument stampDocScript;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
stampDocScript = stampDoc.GetComponent<StampDocument>();
|
||||
}
|
||||
|
||||
private void OnCollisionEnter(Collision collision)
|
||||
{
|
||||
|
@ -26,7 +20,18 @@ public class PenInteractor : MonoBehaviour
|
|||
{
|
||||
if (collision.collider.gameObject.name == "Stamp-Sign Area")
|
||||
{
|
||||
stampDocScript.SignDocument();
|
||||
stampDocScript = collision.gameObject.GetComponent<StampDocument>();
|
||||
|
||||
if(stampDocScript != null)
|
||||
{
|
||||
if(!stampDocScript.isSigned)
|
||||
{
|
||||
stampDocScript.SignDocument();
|
||||
} }
|
||||
else
|
||||
{
|
||||
Debug.LogError("Paper doesn't have StampDocScript");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,10 @@ public class StampDocument : MonoBehaviour
|
|||
[SerializeField] private GameObject disabilitiesStamp;
|
||||
[SerializeField] private GameObject signature;
|
||||
|
||||
public bool isStamped;
|
||||
public bool isSigned;
|
||||
public string assignedService;
|
||||
|
||||
void Start()
|
||||
{
|
||||
financialStamp.SetActive(false);
|
||||
|
@ -17,30 +21,42 @@ public class StampDocument : MonoBehaviour
|
|||
dvStamp.SetActive(false);
|
||||
disabilitiesStamp.SetActive(false);
|
||||
signature.SetActive(false);
|
||||
|
||||
isSigned = false;
|
||||
isStamped = false;
|
||||
}
|
||||
|
||||
public void StampFinancial()
|
||||
{
|
||||
financialStamp.SetActive(true);
|
||||
isStamped = true;
|
||||
assignedService = "Financial";
|
||||
}
|
||||
|
||||
public void StampResidential()
|
||||
{
|
||||
residentialStamp.SetActive(true);
|
||||
isStamped = true;
|
||||
assignedService = "Residential";
|
||||
}
|
||||
|
||||
public void StampDV()
|
||||
{
|
||||
dvStamp.SetActive(true);
|
||||
isStamped = true;
|
||||
assignedService = "Domestic Violence";
|
||||
}
|
||||
|
||||
public void StampDisabilities()
|
||||
{
|
||||
disabilitiesStamp.SetActive(true);
|
||||
isStamped = true;
|
||||
assignedService = "Disabilities";
|
||||
}
|
||||
|
||||
public void SignDocument()
|
||||
{
|
||||
signature.SetActive(true);
|
||||
isSigned = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,14 +7,11 @@ public class StampInteractor : MonoBehaviour
|
|||
{
|
||||
public string stampName;
|
||||
|
||||
[SerializeField] private GameObject stampDoc;
|
||||
private StampDocument stampDocScript;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
stampName = gameObject.name;
|
||||
|
||||
stampDocScript = stampDoc.GetComponent<StampDocument>();
|
||||
}
|
||||
|
||||
private void OnCollisionEnter(Collision collision)
|
||||
|
@ -23,21 +20,30 @@ public class StampInteractor : MonoBehaviour
|
|||
{
|
||||
if (collision.collider.gameObject.name == "Stamp-Sign Area")
|
||||
{
|
||||
if (stampName == "Stamp_Financial")
|
||||
stampDocScript = collision.gameObject.GetComponent<StampDocument>();
|
||||
|
||||
if(stampDocScript != null)
|
||||
{
|
||||
stampDocScript.StampFinancial();
|
||||
if (stampName == "Stamp_Financial" && !stampDocScript.isStamped)
|
||||
{
|
||||
stampDocScript.StampFinancial();
|
||||
}
|
||||
else if (stampName == "Stamp_Residential" && !stampDocScript.isStamped)
|
||||
{
|
||||
stampDocScript.StampResidential();
|
||||
}
|
||||
else if (stampName == "Stamp_DV" && !stampDocScript.isStamped)
|
||||
{
|
||||
stampDocScript.StampDV();
|
||||
}
|
||||
else if (stampName == "Stamp_Disabilities" && !stampDocScript.isStamped)
|
||||
{
|
||||
stampDocScript.StampDisabilities();
|
||||
}
|
||||
}
|
||||
else if (stampName == "Stamp_Residential")
|
||||
else
|
||||
{
|
||||
stampDocScript.StampResidential();
|
||||
}
|
||||
else if (stampName == "Stamp_DV")
|
||||
{
|
||||
stampDocScript.StampDV();
|
||||
}
|
||||
else if (stampName == "Stamp_Disabilities")
|
||||
{
|
||||
stampDocScript.StampDisabilities();
|
||||
Debug.LogError("Paper doesn't have StampDocScript");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue