Compare commits

..

No commits in common. "6d3005d9d75f39a8490c6f90708fcbdbfc7bee62" and "3465373560230e9fda2d6ce35e033542471b661a" have entirely different histories.

9 changed files with 43 additions and 53 deletions

View file

@ -1,18 +1,15 @@
/* using System;
* Author: Mark
* Date: 10/2/2025
* Description: Playground test script for day incrementation and game manager state preservation
*/
using System.Collections; using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine; using UnityEngine;
using UnityEngine.SceneManagement; using UnityEngine.SceneManagement;
public class DayIncrementPlaygroundScript : MonoBehaviour public class DayIncrementPlaygroundScript : MonoBehaviour
{ {
[SerializeField] public bool isBeforeScene; [SerializeField] public bool isBeforeScene = false;
private bool _testHasRun; private bool _testHasRun = false;
private void Update() private void Update()
{ {
@ -24,7 +21,7 @@ public class DayIncrementPlaygroundScript : MonoBehaviour
_testHasRun = true; _testHasRun = true;
} }
private IEnumerator Main() IEnumerator Main()
{ {
if (isBeforeScene) if (isBeforeScene)
{ {
@ -39,8 +36,8 @@ public class DayIncrementPlaygroundScript : MonoBehaviour
Debug.Log($"post-increment day is {GameManager.Instance.currentDay}"); Debug.Log($"post-increment day is {GameManager.Instance.currentDay}");
// change to the next scene // change to the next scene
// ReSharper disable once Unity.LoadSceneDisabledSceneName
SceneManager.LoadScene("Scenes/Testing Scenes/Day Increment Playground After"); SceneManager.LoadScene("Scenes/Testing Scenes/Day Increment Playground After");
} }
else else
{ {

View file

@ -1,9 +1,3 @@
/*
* Author: Mark
* Date: 31/1/2025
* Description: Dynamic configuration script for a drawer interactable
*/
using System; using System;
using UnityEngine; using UnityEngine;
using UnityEngine.XR.Interaction.Toolkit.Interactables; using UnityEngine.XR.Interaction.Toolkit.Interactables;
@ -14,7 +8,6 @@ public class DrawerDynamicJointConfiguration : MonoBehaviour
{ {
[Header("mark's all-in-one dynamic drawer component")] [Header("mark's all-in-one dynamic drawer component")]
[Space(10)] [Space(10)]
#if UNITY_EDITOR
[HelpBox("make sure every child inside both prefabs are under the" + [HelpBox("make sure every child inside both prefabs are under the" +
"'Interactable Environment' layer.\n\n" + "'Interactable Environment' layer.\n\n" +
"whatever non-standard (a la ProBuilder) object geometry under the " + "whatever non-standard (a la ProBuilder) object geometry under the " +
@ -23,7 +16,6 @@ public class DrawerDynamicJointConfiguration : MonoBehaviour
"> 'Near-Far Interactor' > 'Curve Interaction Caster') should be have the " + "> 'Near-Far Interactor' > 'Curve Interaction Caster') should be have the " +
"'Interactable Environment' layer included in its' Raycast Mask.", "'Interactable Environment' layer included in its' Raycast Mask.",
HelpBoxMessageType.Error)] HelpBoxMessageType.Error)]
#endif
[Space(10)] [Space(10)]
[SerializeField] [SerializeField]
private MovementAxis movementAxis = MovementAxis.Z; private MovementAxis movementAxis = MovementAxis.Z;

View file

@ -1,9 +1,5 @@
/* using System.Collections;
* Author: Reza using System.Collections.Generic;
* Date: 13/2/2025
* Description: Car obstacle
*/
using UnityEngine; using UnityEngine;
public class EffectTrigger : MonoBehaviour public class EffectTrigger : MonoBehaviour
@ -11,21 +7,26 @@ public class EffectTrigger : MonoBehaviour
// The effect name to trigger when the player enters this area // The effect name to trigger when the player enters this area
public string effectName; public string effectName;
// Optionally stop the effect when the player exits the trigger zone
private void OnTriggerExit(Collider other)
{
if (other.CompareTag("Player") && PostProcessingManager.Instance.IsEffectActive())
PostProcessingManager.Instance.StopEffect();
}
// Check if the player enters the trigger zone // Check if the player enters the trigger zone
private void OnTriggerStay(Collider other) private void OnTriggerStay(Collider other)
{ {
// Check if the player is in the trigger zone // Check if the player is in the trigger zone
if (!other.CompareTag("Player")) return; if (other.CompareTag("Player"))
{
// Trigger the effect based on the specified effectName
if (!PostProcessingManager.Instance.IsEffectActive())
{
PostProcessingManager.Instance.TriggerEffect(effectName);
}
}
}
// Trigger the effect based on the specified effectName // Optionally stop the effect when the player exits the trigger zone
if (!PostProcessingManager.Instance.IsEffectActive()) private void OnTriggerExit(Collider other)
PostProcessingManager.Instance.TriggerEffect(effectName); {
if (other.CompareTag("Player") && PostProcessingManager.Instance.IsEffectActive())
{
PostProcessingManager.Instance.StopEffect();
}
} }
} }