Worker and secretary audio

This commit is contained in:
journaliciouz
2025-12-18 21:31:48 +01:00
parent c4c513733a
commit 8e4886f7e0
30 changed files with 972 additions and 36 deletions

View File

@@ -1,7 +1,8 @@
using Core.SaveLoad;
using UnityEngine;
using Pixelplacement;
using Pixelplacement.TweenSystem;
using UnityEngine;
using UnityEngine.Audio;
public class WorkerBeltApproachingBehaviour : AppleState
{
@@ -17,8 +18,14 @@ public class WorkerBeltApproachingBehaviour : AppleState
private TweenBase aproachTween;
public AppleMachine workerBeltStateMAchineRef;
public AppleAudioSource audioSource;
public AudioResource approachAudio;
private void OnEnable()
{
audioSource.audioSource.resource = approachAudio;
audioSource.Play(0);
// ensure roaming ref exists before accessing
Transform anchorA = transform.Find("AnchorA");
if (anchorA != null && workerBeltRoamingRef != null)

View File

@@ -4,6 +4,7 @@ using Pixelplacement;
using Pixelplacement.TweenSystem;
using System.Collections;
using System.Runtime.CompilerServices;
using UnityEngine.Audio;
public class WorkerBeltRoamingBehaviour : AppleState
{
@@ -23,10 +24,17 @@ public class WorkerBeltRoamingBehaviour : AppleState
// Reference to the active spline tween so we can pause/stop it
private TweenBase roamingTween;
// Sound refs
public AppleAudioSource audioSource;
public AudioResource roamingWorkerAudio;
public AudioResource fallAudio;
void OnEnable()
{
audioSource.audioSource.resource = roamingWorkerAudio;
audioSource.Play(0);
if (workerAnimator != null)
workerAnimator.SetBool("isLifting?", false);
@@ -120,5 +128,17 @@ public class WorkerBeltRoamingBehaviour : AppleState
{
roamingTween.Stop();
}
public void PlayFallAudio()
{
audioSource.audioSource.resource = fallAudio;
audioSource.Play(0);
}
public void PlayHmAudio()
{
audioSource.audioSource.resource = roamingWorkerAudio;
audioSource.Play(0);
}
}

View File

@@ -1,7 +1,8 @@
using Core.SaveLoad;
using UnityEngine;
using Pixelplacement;
using Pixelplacement.TweenSystem;
using UnityEngine;
using UnityEngine.Audio;
public class WorkerBeltReturningBehaviour : AppleState
{
@@ -19,8 +20,14 @@ public class WorkerBeltReturningBehaviour : AppleState
public Transform StartingAnchor;
public Transform EndingAnchor;
public AppleAudioSource audioSource;
public AudioResource returningAudio;
private void OnEnable()
{
audioSource.audioSource.resource = returningAudio;
audioSource.Play(0);
workerAnimator.runtimeAnimatorController = pantslessController;
workerAnimator.SetBool("pantsDown?", true);

View File

@@ -2,15 +2,19 @@ using UnityEngine;
using Core.Lifecycle;
using Core.SaveLoad;
using System.Collections;
using UnityEngine.Audio;
public class CanStealFlowerStateBehaviour : AppleState
{
public ReceptionistBehaviour receptionistObject;
public AppleAudioSource audioSource;
public AudioResource thinkingAudio;
public void OnEnable()
{
StartCoroutine(holdStateForSeconds(receptionistObject.holdFlowerDuration));
audioSource.audioSource.resource = thinkingAudio;
audioSource.Play(0);
}
public override void OnRestoreState(string data)

View File

@@ -0,0 +1,18 @@
using UnityEngine;
public class ReceptionistAnimEventWrapper : MonoBehaviour
{
public ReceptionistCountingBehavior countingBehavior;
public void PlayLoveAudio(string lovesMe)
{
if (lovesMe == "true")
{
countingBehavior.PlayCountingAudio(true);
}
else
{
countingBehavior.PlayCountingAudio(false);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: a6a11442976e9fe4182f597f6647ea02

View File

@@ -0,0 +1,23 @@
using UnityEngine;
using UnityEngine.Audio;
public class ReceptionistCountingBehavior : MonoBehaviour
{
public AudioResource lovesMeAudio;
public AudioResource lovesMeNotAudio;
public AppleAudioSource audioSource;
public void PlayCountingAudio(bool lovesMe)
{
if (lovesMe)
{
audioSource.audioSource.resource = lovesMeAudio;
}
else
{
audioSource.audioSource.resource = lovesMeNotAudio;
}
audioSource.Play(0);
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 7e1ac173ceb63224fae2229c534c6e0a

View File

@@ -7,11 +7,14 @@ public class RoamingWorkerAnimationEvents : MonoBehaviour
public void WorkerGotUp()
{
roamingBehaviour.ContinueRoaming();
roamingBehaviour.PlayHmAudio();
}
public void PauseTween()
{
roamingBehaviour.PauseRoaming();
roamingBehaviour.PlayFallAudio();
}
}

View File

@@ -0,0 +1,14 @@
using UnityEngine;
using UnityEngine.Audio;
public class ThrowAwayFlowerBehaviour : MonoBehaviour
{
public AppleAudioSource audioSource;
public AudioResource doesNotCountAudio;
public void OnEnable()
{
audioSource.audioSource.resource = doesNotCountAudio;
audioSource.Play(0);
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 9d759cbc7c55f9046b46029991aca347

View File

@@ -1,13 +1,20 @@
using UnityEngine;
using Core.SaveLoad;
using UnityEngine;
using UnityEngine.Audio;
public class WorkerLiftingStateBehavior : AppleState
{
public GameObject roamingWorker;
public AppleAudioSource audioSource;
public AudioResource liftingAudio;
public override void OnEnterState()
{
roamingWorker.SetActive(false);
audioSource.audioSource.resource = liftingAudio;
audioSource.Play(0);
}