Update methods to be internal, remove invocation bloat

This commit is contained in:
Michal Pikulski
2025-11-10 21:59:47 +01:00
parent 01caca1878
commit a049c6a750
42 changed files with 137 additions and 136 deletions

View File

@@ -20,12 +20,12 @@ public class AppleAudioSource : ManagedBehaviour
public int sourcePriority;
protected override void OnManagedAwake()
internal override void OnManagedAwake()
{
audioSource = GetComponent<AudioSource>();
}
protected override void OnManagedStart()
internal override void OnManagedStart()
{
AudioManager.Instance.RegisterNewAudioSource(this);
_audioMixer = AudioManager.Instance.audioMixer;

View File

@@ -44,13 +44,13 @@ public class AudioManager : ManagedBehaviour, IPausable
public override int ManagedAwakePriority => 30; // Audio infrastructure
public override bool AutoRegisterPausable => true; // Auto-register as IPausable
protected override void OnManagedAwake()
internal override void OnManagedAwake()
{
// Set instance immediately (early initialization)
_instance = this;
}
protected override void OnManagedStart()
internal override void OnManagedStart()
{
// Initialize lists if they were not set in inspector
criticalVOSources = criticalVOSources ?? new List<AppleAudioSource>();

View File

@@ -23,7 +23,7 @@ public class BushAudioController : ManagedBehaviour
// Start is called once before the first execution of Update after the MonoBehaviour is created
protected override void OnManagedStart()
internal override void OnManagedStart()
{
_eventSource = VOPlayer.audioSource.RequestEventHandlers();
_eventSource.AudioStopped += PlayBirdCounter;

View File

@@ -26,7 +26,7 @@ public class LevelAudioObject : ManagedBehaviour
public override bool AutoRegisterForSave => isOneTime; // Only save if one-time audio
protected override string OnSceneSaveRequested()
internal override string OnSceneSaveRequested()
{
if (!isOneTime)
return null; // No need to save if not one-time
@@ -39,7 +39,7 @@ public class LevelAudioObject : ManagedBehaviour
return JsonUtility.ToJson(saveData);
}
protected override void OnSceneRestoreRequested(string serializedData)
internal override void OnSceneRestoreRequested(string serializedData)
{
if (!isOneTime || string.IsNullOrEmpty(serializedData))
return;
@@ -55,7 +55,7 @@ public class LevelAudioObject : ManagedBehaviour
}
}
protected override void OnSceneRestoreCompleted()
internal override void OnSceneRestoreCompleted()
{
if (isOneTime && !_hasPlayed)
{

View File

@@ -10,7 +10,7 @@ public class PulverAudioController : ManagedBehaviour
private FollowerController followerController;
public ItemManager itemManager;
protected override void OnManagedStart()
internal override void OnManagedStart()
{
followerController = GetComponent<FollowerController>();
followerController.PulverIsCombining.AddListener(PulverIsCombining);