game: checking if correct stamp
This commit is contained in:
parent
5b5e16d4db
commit
ddd3e4be82
5 changed files with 49 additions and 26 deletions
|
@ -23,7 +23,6 @@ public class GameManager : MonoBehaviour
|
||||||
public bool shiftStarted;
|
public bool shiftStarted;
|
||||||
|
|
||||||
public GameObject currentNPC;
|
public GameObject currentNPC;
|
||||||
public GameObject currentStampDoc;
|
|
||||||
|
|
||||||
[Header("Walk Points (FOR DEBUGGING")]
|
[Header("Walk Points (FOR DEBUGGING")]
|
||||||
public Transform[] frontWalkPoints;
|
public Transform[] frontWalkPoints;
|
||||||
|
|
|
@ -25,7 +25,4 @@ public class NpcData
|
||||||
public int points;
|
public int points;
|
||||||
public bool hasPaper;
|
public bool hasPaper;
|
||||||
public string correctDepartment;
|
public string correctDepartment;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -12,13 +12,7 @@ using UnityEngine.XR.Interaction.Toolkit;
|
||||||
using UnityEngine.XR.Interaction.Toolkit.Interactors;
|
using UnityEngine.XR.Interaction.Toolkit.Interactors;
|
||||||
public class PenInteractor : MonoBehaviour
|
public class PenInteractor : MonoBehaviour
|
||||||
{
|
{
|
||||||
[SerializeField] private GameObject stampDoc;
|
|
||||||
private StampDocument stampDocScript;
|
private StampDocument stampDocScript;
|
||||||
|
|
||||||
void Awake()
|
|
||||||
{
|
|
||||||
stampDocScript = stampDoc.GetComponent<StampDocument>();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnCollisionEnter(Collision collision)
|
private void OnCollisionEnter(Collision collision)
|
||||||
{
|
{
|
||||||
|
@ -26,7 +20,18 @@ public class PenInteractor : MonoBehaviour
|
||||||
{
|
{
|
||||||
if (collision.collider.gameObject.name == "Stamp-Sign Area")
|
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 disabilitiesStamp;
|
||||||
[SerializeField] private GameObject signature;
|
[SerializeField] private GameObject signature;
|
||||||
|
|
||||||
|
public bool isStamped;
|
||||||
|
public bool isSigned;
|
||||||
|
public string assignedService;
|
||||||
|
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
financialStamp.SetActive(false);
|
financialStamp.SetActive(false);
|
||||||
|
@ -17,30 +21,42 @@ public class StampDocument : MonoBehaviour
|
||||||
dvStamp.SetActive(false);
|
dvStamp.SetActive(false);
|
||||||
disabilitiesStamp.SetActive(false);
|
disabilitiesStamp.SetActive(false);
|
||||||
signature.SetActive(false);
|
signature.SetActive(false);
|
||||||
|
|
||||||
|
isSigned = false;
|
||||||
|
isStamped = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void StampFinancial()
|
public void StampFinancial()
|
||||||
{
|
{
|
||||||
financialStamp.SetActive(true);
|
financialStamp.SetActive(true);
|
||||||
|
isStamped = true;
|
||||||
|
assignedService = "Financial";
|
||||||
}
|
}
|
||||||
|
|
||||||
public void StampResidential()
|
public void StampResidential()
|
||||||
{
|
{
|
||||||
residentialStamp.SetActive(true);
|
residentialStamp.SetActive(true);
|
||||||
|
isStamped = true;
|
||||||
|
assignedService = "Residential";
|
||||||
}
|
}
|
||||||
|
|
||||||
public void StampDV()
|
public void StampDV()
|
||||||
{
|
{
|
||||||
dvStamp.SetActive(true);
|
dvStamp.SetActive(true);
|
||||||
|
isStamped = true;
|
||||||
|
assignedService = "Domestic Violence";
|
||||||
}
|
}
|
||||||
|
|
||||||
public void StampDisabilities()
|
public void StampDisabilities()
|
||||||
{
|
{
|
||||||
disabilitiesStamp.SetActive(true);
|
disabilitiesStamp.SetActive(true);
|
||||||
|
isStamped = true;
|
||||||
|
assignedService = "Disabilities";
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SignDocument()
|
public void SignDocument()
|
||||||
{
|
{
|
||||||
signature.SetActive(true);
|
signature.SetActive(true);
|
||||||
|
isSigned = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,14 +7,11 @@ public class StampInteractor : MonoBehaviour
|
||||||
{
|
{
|
||||||
public string stampName;
|
public string stampName;
|
||||||
|
|
||||||
[SerializeField] private GameObject stampDoc;
|
|
||||||
private StampDocument stampDocScript;
|
private StampDocument stampDocScript;
|
||||||
|
|
||||||
void Awake()
|
void Awake()
|
||||||
{
|
{
|
||||||
stampName = gameObject.name;
|
stampName = gameObject.name;
|
||||||
|
|
||||||
stampDocScript = stampDoc.GetComponent<StampDocument>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnCollisionEnter(Collision collision)
|
private void OnCollisionEnter(Collision collision)
|
||||||
|
@ -23,21 +20,30 @@ public class StampInteractor : MonoBehaviour
|
||||||
{
|
{
|
||||||
if (collision.collider.gameObject.name == "Stamp-Sign Area")
|
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();
|
Debug.LogError("Paper doesn't have StampDocScript");
|
||||||
}
|
|
||||||
else if (stampName == "Stamp_DV")
|
|
||||||
{
|
|
||||||
stampDocScript.StampDV();
|
|
||||||
}
|
|
||||||
else if (stampName == "Stamp_Disabilities")
|
|
||||||
{
|
|
||||||
stampDocScript.StampDisabilities();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue