game: flow and ui done, making info collecting flow now
This commit is contained in:
parent
13b886dba4
commit
39837f913a
5 changed files with 190 additions and 60 deletions
|
@ -14132,6 +14132,140 @@ Mesh:
|
||||||
offset: 0
|
offset: 0
|
||||||
size: 0
|
size: 0
|
||||||
path:
|
path:
|
||||||
|
--- !u!1 &197586934
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 197586935}
|
||||||
|
- component: {fileID: 197586937}
|
||||||
|
- component: {fileID: 197586936}
|
||||||
|
m_Layer: 5
|
||||||
|
m_Name: Tasks Completed
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!224 &197586935
|
||||||
|
RectTransform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 197586934}
|
||||||
|
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||||
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
|
m_ConstrainProportionsScale: 0
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 1776114652}
|
||||||
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
|
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||||
|
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||||
|
m_AnchoredPosition: {x: 45, y: -191}
|
||||||
|
m_SizeDelta: {x: 200, y: 50}
|
||||||
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
|
--- !u!114 &197586936
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 197586934}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
m_RaycastTarget: 1
|
||||||
|
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
m_Maskable: 1
|
||||||
|
m_OnCullStateChanged:
|
||||||
|
m_PersistentCalls:
|
||||||
|
m_Calls: []
|
||||||
|
m_text: I think I did everything... I think I can leave for school now
|
||||||
|
m_isRightToLeft: 0
|
||||||
|
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
||||||
|
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
||||||
|
m_fontSharedMaterials: []
|
||||||
|
m_fontMaterial: {fileID: 0}
|
||||||
|
m_fontMaterials: []
|
||||||
|
m_fontColor32:
|
||||||
|
serializedVersion: 2
|
||||||
|
rgba: 4294967295
|
||||||
|
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
m_enableVertexGradient: 0
|
||||||
|
m_colorMode: 3
|
||||||
|
m_fontColorGradient:
|
||||||
|
topLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
topRight: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
bottomRight: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
m_fontColorGradientPreset: {fileID: 0}
|
||||||
|
m_spriteAsset: {fileID: 0}
|
||||||
|
m_tintAllSprites: 0
|
||||||
|
m_StyleSheet: {fileID: 0}
|
||||||
|
m_TextStyleHashCode: -1183493901
|
||||||
|
m_overrideHtmlColors: 0
|
||||||
|
m_faceColor:
|
||||||
|
serializedVersion: 2
|
||||||
|
rgba: 4294967295
|
||||||
|
m_fontSize: 20
|
||||||
|
m_fontSizeBase: 20
|
||||||
|
m_fontWeight: 400
|
||||||
|
m_enableAutoSizing: 0
|
||||||
|
m_fontSizeMin: 18
|
||||||
|
m_fontSizeMax: 72
|
||||||
|
m_fontStyle: 0
|
||||||
|
m_HorizontalAlignment: 2
|
||||||
|
m_VerticalAlignment: 512
|
||||||
|
m_textAlignment: 65535
|
||||||
|
m_characterSpacing: 0
|
||||||
|
m_wordSpacing: 0
|
||||||
|
m_lineSpacing: 0
|
||||||
|
m_lineSpacingMax: 0
|
||||||
|
m_paragraphSpacing: 0
|
||||||
|
m_charWidthMaxAdj: 0
|
||||||
|
m_enableWordWrapping: 1
|
||||||
|
m_wordWrappingRatios: 0.4
|
||||||
|
m_overflowMode: 0
|
||||||
|
m_linkedTextComponent: {fileID: 0}
|
||||||
|
parentLinkedComponent: {fileID: 0}
|
||||||
|
m_enableKerning: 1
|
||||||
|
m_enableExtraPadding: 0
|
||||||
|
checkPaddingRequired: 0
|
||||||
|
m_isRichText: 1
|
||||||
|
m_parseCtrlCharacters: 1
|
||||||
|
m_isOrthographic: 1
|
||||||
|
m_isCullingEnabled: 0
|
||||||
|
m_horizontalMapping: 0
|
||||||
|
m_verticalMapping: 0
|
||||||
|
m_uvLineOffset: 0
|
||||||
|
m_geometrySortingOrder: 0
|
||||||
|
m_IsTextObjectScaleStatic: 0
|
||||||
|
m_VertexBufferAutoSizeReduction: 0
|
||||||
|
m_useMaxVisibleDescender: 1
|
||||||
|
m_pageToDisplay: 1
|
||||||
|
m_margin: {x: -234.78311, y: 0, z: -121.96213, w: 0}
|
||||||
|
m_isUsingLegacyAnimationComponent: 0
|
||||||
|
m_isVolumetricText: 0
|
||||||
|
m_hasFontAssetChanged: 0
|
||||||
|
m_baseMaterial: {fileID: 0}
|
||||||
|
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
--- !u!222 &197586937
|
||||||
|
CanvasRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 197586934}
|
||||||
|
m_CullTransparentMesh: 1
|
||||||
--- !u!1 &198323985
|
--- !u!1 &198323985
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -116342,6 +116476,7 @@ RectTransform:
|
||||||
- {fileID: 1177838949}
|
- {fileID: 1177838949}
|
||||||
- {fileID: 620624015}
|
- {fileID: 620624015}
|
||||||
- {fileID: 1839460624}
|
- {fileID: 1839460624}
|
||||||
|
- {fileID: 197586935}
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 0}
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
|
@ -143235,12 +143370,14 @@ MonoBehaviour:
|
||||||
trashRequired: 1
|
trashRequired: 1
|
||||||
door: {fileID: 214241217}
|
door: {fileID: 214241217}
|
||||||
lockedDoorUI: {fileID: 1786768887}
|
lockedDoorUI: {fileID: 1786768887}
|
||||||
|
storyPanelUI: {fileID: 620624014}
|
||||||
|
storyText: {fileID: 1214791149}
|
||||||
audioSource: {fileID: 1898819871}
|
audioSource: {fileID: 1898819871}
|
||||||
lockedSound: {fileID: 8300000, guid: 66df24e59b960964d967e61a34192cc5, type: 3}
|
lockedSound: {fileID: 8300000, guid: 66df24e59b960964d967e61a34192cc5, type: 3}
|
||||||
unlockedSound: {fileID: 8300000, guid: 52fae69899b3fc24694a0f879a7d821a, type: 3}
|
unlockedSound: {fileID: 8300000, guid: 52fae69899b3fc24694a0f879a7d821a, type: 3}
|
||||||
footstepsSound: {fileID: 8300000, guid: 4e0d17ae4f88eb0438e2148301bb6bd5, type: 3}
|
footstepsSound: {fileID: 8300000, guid: 4e0d17ae4f88eb0438e2148301bb6bd5, type: 3}
|
||||||
doorSlamSound: {fileID: 8300000, guid: 3bc52e150f066454883c18b25be2b983, type: 3}
|
doorSlamSound: {fileID: 8300000, guid: 3bc52e150f066454883c18b25be2b983, type: 3}
|
||||||
throwTrashSound: {fileID: 8300000, guid: c203d3014d6d6d94ea98b5a50d5a9b67, type: 3}
|
throwTrashSound: {fileID: 0}
|
||||||
--- !u!43 &2060072005
|
--- !u!43 &2060072005
|
||||||
Mesh:
|
Mesh:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
@ -16,7 +16,6 @@ public class BedroomTask : MonoBehaviour
|
||||||
{
|
{
|
||||||
private GameManager gameManager;
|
private GameManager gameManager;
|
||||||
private PostProcessingManager postProcessingManager;
|
private PostProcessingManager postProcessingManager;
|
||||||
private StorylineManager storylineManager;
|
|
||||||
|
|
||||||
[Header("Task Requirement Values")]
|
[Header("Task Requirement Values")]
|
||||||
// To track how much trash has been collected so far
|
// To track how much trash has been collected so far
|
||||||
|
@ -41,8 +40,8 @@ public class BedroomTask : MonoBehaviour
|
||||||
// Defines UI references
|
// Defines UI references
|
||||||
[Header("UI References")]
|
[Header("UI References")]
|
||||||
public GameObject lockedDoorUI;
|
public GameObject lockedDoorUI;
|
||||||
//public GameObject storyPanelUI;
|
public GameObject storyPanelUI;
|
||||||
//public TMP_Text storyText;
|
public TMP_Text storyText;
|
||||||
|
|
||||||
// Defines Audio References
|
// Defines Audio References
|
||||||
[Header("Audio References")]
|
[Header("Audio References")]
|
||||||
|
@ -55,8 +54,6 @@ public class BedroomTask : MonoBehaviour
|
||||||
|
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
storylineManager = FindObjectOfType<StorylineManager>();
|
|
||||||
|
|
||||||
// Hide all UI prompts on start
|
// Hide all UI prompts on start
|
||||||
lockedDoorUI.SetActive(false);
|
lockedDoorUI.SetActive(false);
|
||||||
//unlockedDoorUI.SetActive(false);
|
//unlockedDoorUI.SetActive(false);
|
||||||
|
@ -84,13 +81,13 @@ public class BedroomTask : MonoBehaviour
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
storylineManager.EnqueueMessage("My parents are still home... I should wait for them to leave.", 7f);
|
if (storyPanelUI != null && storyText != null)
|
||||||
/*if (storyPanelUI != null && storyText != null)
|
|
||||||
{
|
{
|
||||||
storyPanelUI.SetActive(true);
|
storyPanelUI.SetActive(true);
|
||||||
storyText.text = "My parents are still home... I should clean up first.";
|
storyText.text = "My parents are still home... I should clean up first.";
|
||||||
StartCoroutine(ClearMessageAfterSeconds(7f));
|
StartCoroutine(ClearMessageAfterSeconds(7f));
|
||||||
}*/
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Functions when trash is collected/thrown
|
// Functions when trash is collected/thrown
|
||||||
|
@ -211,9 +208,8 @@ public class BedroomTask : MonoBehaviour
|
||||||
{
|
{
|
||||||
PostProcessingManager.Instance.TriggerEffect("Panic");
|
PostProcessingManager.Instance.TriggerEffect("Panic");
|
||||||
|
|
||||||
storylineManager.EnqueueMessage("!!!", 7f);
|
storyPanelUI.SetActive(true);
|
||||||
/*storyPanelUI.SetActive(true);
|
storyText.text = "!!!";
|
||||||
storyText.text = "!!!";*/
|
|
||||||
|
|
||||||
// Play footsteps of parents walking away
|
// Play footsteps of parents walking away
|
||||||
audioSource.PlayOneShot(footstepsSound);
|
audioSource.PlayOneShot(footstepsSound);
|
||||||
|
@ -227,15 +223,13 @@ public class BedroomTask : MonoBehaviour
|
||||||
PostProcessingManager.Instance.StopEffect("Panic");
|
PostProcessingManager.Instance.StopEffect("Panic");
|
||||||
|
|
||||||
// Clear the "!!!"
|
// Clear the "!!!"
|
||||||
//storyText.text = "";
|
storyText.text = "";
|
||||||
|
|
||||||
// Unlocks the door after the clips and update the story
|
// Unlocks the door after the clips and update the story
|
||||||
UnlockDoor();
|
UnlockDoor();
|
||||||
|
|
||||||
|
storyText.text = "They finally left... just as soon as I finished cleaning. I can leave the room now.";
|
||||||
storylineManager.EnqueueMessage("They finally left... I can leave the room now", 5f);
|
StartCoroutine(ClearMessageAfterSeconds(7f));
|
||||||
/*storyText.text = "They finally left just as soon as I finished cleaning. I can leave the room now.";
|
|
||||||
StartCoroutine(ClearMessageAfterSeconds(7f));*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Function to hide the UI after a delay
|
// Function to hide the UI after a delay
|
||||||
|
@ -243,7 +237,7 @@ public class BedroomTask : MonoBehaviour
|
||||||
{
|
{
|
||||||
// Waits for delay to end and hides the UI
|
// Waits for delay to end and hides the UI
|
||||||
yield return new WaitForSeconds(delay);
|
yield return new WaitForSeconds(delay);
|
||||||
//storyText.text = "";
|
storyText.text = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerator HidePanelAfterSeconds(GameObject uiElement, float delay)
|
private IEnumerator HidePanelAfterSeconds(GameObject uiElement, float delay)
|
||||||
|
|
|
@ -13,7 +13,6 @@ public class BroomSweeping : MonoBehaviour
|
||||||
{
|
{
|
||||||
private GameManager gameManager;
|
private GameManager gameManager;
|
||||||
private PostProcessingManager postProcessingManager;
|
private PostProcessingManager postProcessingManager;
|
||||||
private StorylineManager storylineManager;
|
|
||||||
|
|
||||||
// To track how much trash has been collected so far
|
// To track how much trash has been collected so far
|
||||||
public int dirtSweeped = 0;
|
public int dirtSweeped = 0;
|
||||||
|
@ -25,7 +24,7 @@ public class BroomSweeping : MonoBehaviour
|
||||||
|
|
||||||
// Defines UI references
|
// Defines UI references
|
||||||
[Header("UI References")]
|
[Header("UI References")]
|
||||||
//public GameObject storyPanelUI;
|
public GameObject storyPanelUI;
|
||||||
public TMP_Text storyText;
|
public TMP_Text storyText;
|
||||||
|
|
||||||
// Defines Audio References
|
// Defines Audio References
|
||||||
|
@ -33,11 +32,6 @@ public class BroomSweeping : MonoBehaviour
|
||||||
public AudioSource audioSource;
|
public AudioSource audioSource;
|
||||||
public AudioClip sweepingSound;
|
public AudioClip sweepingSound;
|
||||||
|
|
||||||
void Start()
|
|
||||||
{
|
|
||||||
storylineManager = FindObjectOfType<StorylineManager>();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update is called once per frame
|
// Update is called once per frame
|
||||||
void Update()
|
void Update()
|
||||||
{
|
{
|
||||||
|
@ -46,12 +40,10 @@ public class BroomSweeping : MonoBehaviour
|
||||||
taskCompleted = true;
|
taskCompleted = true;
|
||||||
GameManager.Instance.FloorSweepedTaskComplete();
|
GameManager.Instance.FloorSweepedTaskComplete();
|
||||||
|
|
||||||
//storyPanelUI.SetActive(true);
|
storyPanelUI.SetActive(true);
|
||||||
//storyText.text = "I hope the house is clean enough now so I don't get scolded later...";
|
storyText.text = "I hope the house is clean enough now so I don't get scolded later...";
|
||||||
|
|
||||||
storylineManager.EnqueueMessage("I tried my best... Hopefully I don't get scolded later.", 7f);
|
StartCoroutine(ClearMessageAfterSeconds(7f));
|
||||||
|
|
||||||
//StartCoroutine(ClearMessageAfterSeconds(7f));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,6 @@ using TMPro;
|
||||||
public class BrushTeeth : MonoBehaviour
|
public class BrushTeeth : MonoBehaviour
|
||||||
{
|
{
|
||||||
private GameManager gameManager;
|
private GameManager gameManager;
|
||||||
private StorylineManager storylineManager;
|
|
||||||
|
|
||||||
public Slider progressBar; // Reference to the Slider (progress bar)
|
public Slider progressBar; // Reference to the Slider (progress bar)
|
||||||
public float progressTime = 5f; // Time for the progress bar to complete
|
public float progressTime = 5f; // Time for the progress bar to complete
|
||||||
|
@ -39,8 +38,6 @@ public class BrushTeeth : MonoBehaviour
|
||||||
|
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
storylineManager = FindObjectOfType<StorylineManager>();
|
|
||||||
|
|
||||||
grabInteractable = GetComponent<XRGrabInteractable>();
|
grabInteractable = GetComponent<XRGrabInteractable>();
|
||||||
|
|
||||||
if (grabInteractable == null)
|
if (grabInteractable == null)
|
||||||
|
@ -127,13 +124,11 @@ public class BrushTeeth : MonoBehaviour
|
||||||
|
|
||||||
GameManager.Instance.BrushTeethTaskComplete();
|
GameManager.Instance.BrushTeethTaskComplete();
|
||||||
|
|
||||||
storylineManager.EnqueueMessage("I should be fresh enough to go to school...", 7f);
|
storyPanelUI.SetActive(true);
|
||||||
|
storyText.text = "I should be fresh enough to go to school now...";
|
||||||
//storyPanelUI.SetActive(true);
|
|
||||||
//storyText.text = "I should be fresh enough to go to school now...";
|
|
||||||
|
|
||||||
// Clear the text after a delay
|
// Clear the text after a delay
|
||||||
//StartCoroutine(ClearMessageAfterSeconds(7f));
|
StartCoroutine(ClearMessageAfterSeconds(7f));
|
||||||
|
|
||||||
Debug.Log("Progress completed!");
|
Debug.Log("Progress completed!");
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,6 @@ using TMPro;
|
||||||
|
|
||||||
public class GameManager : MonoBehaviour
|
public class GameManager : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Define instance field for accessing the singleton elsewhere
|
/// Define instance field for accessing the singleton elsewhere
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -27,6 +26,10 @@ public class GameManager : MonoBehaviour
|
||||||
private bool teethBrushed = false;
|
private bool teethBrushed = false;
|
||||||
private bool floorSweeped = false;
|
private bool floorSweeped = false;
|
||||||
|
|
||||||
|
// Queue for managing messages
|
||||||
|
private Queue<string> messageQueue = new Queue<string>();
|
||||||
|
private bool isMessageActive = false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks if tasks are completed
|
/// Checks if tasks are completed
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -54,16 +57,36 @@ public class GameManager : MonoBehaviour
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start is called before the first frame update
|
|
||||||
void Start()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update is called once per frame
|
// Update is called once per frame
|
||||||
void Update()
|
void Update()
|
||||||
{
|
{
|
||||||
|
// Continuously check and display queued messages
|
||||||
|
if (!isMessageActive && messageQueue.Count > 0)
|
||||||
|
{
|
||||||
|
string nextMessage = messageQueue.Dequeue();
|
||||||
|
StartCoroutine(DisplayMessage(nextMessage));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Queues a message to be displayed
|
||||||
|
/// </summary>
|
||||||
|
public void QueueMessage(string message)
|
||||||
|
{
|
||||||
|
messageQueue.Enqueue(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Displays a message and waits for it to disappear
|
||||||
|
/// </summary>
|
||||||
|
private IEnumerator DisplayMessage(string message)
|
||||||
|
{
|
||||||
|
isMessageActive = true;
|
||||||
|
storyPanelUI.SetActive(true);
|
||||||
|
storyText.text = message;
|
||||||
|
yield return new WaitForSeconds(7f); // Wait for 7 seconds before hiding
|
||||||
|
storyPanelUI.SetActive(false);
|
||||||
|
isMessageActive = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Logs player's choices before leaving the house (for future Firebase tracking)
|
// Logs player's choices before leaving the house (for future Firebase tracking)
|
||||||
|
@ -73,18 +96,13 @@ public class GameManager : MonoBehaviour
|
||||||
Debug.Log("Bedroom Cleaned: " + bedroomCleaned);
|
Debug.Log("Bedroom Cleaned: " + bedroomCleaned);
|
||||||
Debug.Log("Teeth Brushed: " + teethBrushed);
|
Debug.Log("Teeth Brushed: " + teethBrushed);
|
||||||
Debug.Log("Floor Sweeped: " + floorSweeped);
|
Debug.Log("Floor Sweeped: " + floorSweeped);
|
||||||
|
|
||||||
// Future-proofing for Firebase tracking
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AreTasksDone()
|
public void AreTasksDone()
|
||||||
{
|
{
|
||||||
Debug.Log("TASKS ARE DONE");
|
|
||||||
if (bedroomCleaned && teethBrushed && floorSweeped)
|
if (bedroomCleaned && teethBrushed && floorSweeped)
|
||||||
{
|
{
|
||||||
storyPanelUI.SetActive(true);
|
QueueMessage("I think I did everything... I think I can leave for school now");
|
||||||
storyText.text = "I think I did everything... I should go to school now";
|
|
||||||
StartCoroutine(HideMessageAfterSeconds(storyPanelUI, 7f));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,10 +126,4 @@ public class GameManager : MonoBehaviour
|
||||||
floorSweeped = true;
|
floorSweeped = true;
|
||||||
AreTasksDone();
|
AreTasksDone();
|
||||||
}
|
}
|
||||||
private IEnumerator HideMessageAfterSeconds(GameObject uiElement, float delay)
|
|
||||||
{
|
|
||||||
// Waits for delay to end and hides the UI
|
|
||||||
yield return new WaitForSeconds(delay);
|
|
||||||
uiElement.SetActive(false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue