Compare commits
4 commits
3465373560
...
6d3005d9d7
Author | SHA1 | Date | |
---|---|---|---|
6d3005d9d7 | |||
fc9b9ac330 | |||
71b7a3b919 | |||
d326e662dd |
9 changed files with 54 additions and 44 deletions
|
@ -1,15 +1,18 @@
|
|||
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.Generic;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class DayIncrementPlaygroundScript : MonoBehaviour
|
||||
{
|
||||
[SerializeField] public bool isBeforeScene = false;
|
||||
[SerializeField] public bool isBeforeScene;
|
||||
|
||||
private bool _testHasRun = false;
|
||||
private bool _testHasRun;
|
||||
|
||||
private void Update()
|
||||
{
|
||||
|
@ -21,7 +24,7 @@ public class DayIncrementPlaygroundScript : MonoBehaviour
|
|||
_testHasRun = true;
|
||||
}
|
||||
|
||||
IEnumerator Main()
|
||||
private IEnumerator Main()
|
||||
{
|
||||
if (isBeforeScene)
|
||||
{
|
||||
|
@ -36,8 +39,8 @@ public class DayIncrementPlaygroundScript : MonoBehaviour
|
|||
Debug.Log($"post-increment day is {GameManager.Instance.currentDay}");
|
||||
|
||||
// change to the next scene
|
||||
// ReSharper disable once Unity.LoadSceneDisabledSceneName
|
||||
SceneManager.LoadScene("Scenes/Testing Scenes/Day Increment Playground After");
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
/*
|
||||
* Author: Mark
|
||||
* Date: 31/1/2025
|
||||
* Description: Dynamic configuration script for a drawer interactable
|
||||
*/
|
||||
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.XR.Interaction.Toolkit.Interactables;
|
||||
|
@ -8,6 +14,7 @@ public class DrawerDynamicJointConfiguration : MonoBehaviour
|
|||
{
|
||||
[Header("mark's all-in-one dynamic drawer component")]
|
||||
[Space(10)]
|
||||
#if UNITY_EDITOR
|
||||
[HelpBox("make sure every child inside both prefabs are under the" +
|
||||
"'Interactable Environment' layer.\n\n" +
|
||||
"whatever non-standard (a la ProBuilder) object geometry under the " +
|
||||
|
@ -16,6 +23,7 @@ public class DrawerDynamicJointConfiguration : MonoBehaviour
|
|||
"> 'Near-Far Interactor' > 'Curve Interaction Caster') should be have the " +
|
||||
"'Interactable Environment' layer included in its' Raycast Mask.",
|
||||
HelpBoxMessageType.Error)]
|
||||
#endif
|
||||
[Space(10)]
|
||||
[SerializeField]
|
||||
private MovementAxis movementAxis = MovementAxis.Z;
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
/*
|
||||
* Author: Reza
|
||||
* Date: 13/2/2025
|
||||
* Description: Car obstacle
|
||||
*/
|
||||
|
||||
using UnityEngine;
|
||||
|
||||
public class EffectTrigger : MonoBehaviour
|
||||
|
@ -7,26 +11,21 @@ public class EffectTrigger : MonoBehaviour
|
|||
// The effect name to trigger when the player enters this area
|
||||
public string effectName;
|
||||
|
||||
// Check if the player enters the trigger zone
|
||||
private void OnTriggerStay(Collider other)
|
||||
{
|
||||
// Check if the player is in the trigger zone
|
||||
if (other.CompareTag("Player"))
|
||||
{
|
||||
// Trigger the effect based on the specified effectName
|
||||
if (!PostProcessingManager.Instance.IsEffectActive())
|
||||
{
|
||||
PostProcessingManager.Instance.TriggerEffect(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
|
||||
private void OnTriggerStay(Collider other)
|
||||
{
|
||||
// Check if the player is in the trigger zone
|
||||
if (!other.CompareTag("Player")) return;
|
||||
|
||||
// Trigger the effect based on the specified effectName
|
||||
if (!PostProcessingManager.Instance.IsEffectActive())
|
||||
PostProcessingManager.Instance.TriggerEffect(effectName);
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue