game(scripts): scripts for bedroom task

This commit is contained in:
rezazfn 2025-02-04 09:08:06 +08:00
parent 22bf3d42a3
commit 04c2079cbc
6 changed files with 112 additions and 0 deletions

View file

@ -0,0 +1,31 @@
/*
Author: Reza
Date: 3/2/25
Description: To track if cleaning/exploring bedroom task is done before allowing player to open door
*/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR.Interaction.Toolkit.Interactables;
public class BedroomTask : MonoBehaviour
{
public GameObject door;
public XRGrabInteractable doorInteractable;
private bool taskCompleted = false;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 5400e1a957408e941ba95a252e2d15b0
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,24 @@
/*
Author: Reza
Date: 3/2/25
Description: To keep track of tasks and game mechanics
*/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GameManager : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e01448acf10665b469bdbd43de140feb
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,24 @@
/*
Author: Reza
Date: 4/2/25
Description: To track how much trash has been thrown in the trashbin
*/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Trash : MonoBehaviour
{
public static int trashCollected = 0;
private void OnTriggerEnter(Collider other)
{
if (other.gameObject.CompareTag("TrashBin"))
{
trashCollected++;
Debug.Log("Trash thrown in the bin! Count: " + trashCollected);
Destroy(gameObject);
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 6e292e1c5922f8a4c96ae4cfb85107e4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: