Sequence complete after cleanup

This commit is contained in:
Michal Pikulski
2025-11-02 10:30:59 +01:00
parent 9826dd1aa2
commit 803d649119
7 changed files with 478893 additions and 32 deletions

View File

@@ -150,4 +150,19 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 66cdab2e217c4c8388e2fc66da02f296, type: 3} m_Script: {fileID: 11500000, guid: 66cdab2e217c4c8388e2fc66da02f296, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
isOneTime: 0
cooldown: -1
characterToInteract: 0
interactionStarted:
m_PersistentCalls:
m_Calls: []
interactionInterrupted:
m_PersistentCalls:
m_Calls: []
characterArrived:
m_PersistentCalls:
m_Calls: []
interactionComplete:
m_PersistentCalls:
m_Calls: []
switchData: {fileID: 0} switchData: {fileID: 0}

View File

@@ -150,4 +150,19 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: d9b7a2b4b1fe492aae7b0f280b4063cf, type: 3} m_Script: {fileID: 11500000, guid: d9b7a2b4b1fe492aae7b0f280b4063cf, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: AppleHillsScripts::Levels.MinigameSwitch m_EditorClassIdentifier: AppleHillsScripts::Levels.MinigameSwitch
isOneTime: 0
cooldown: -1
characterToInteract: 0
interactionStarted:
m_PersistentCalls:
m_Calls: []
interactionInterrupted:
m_PersistentCalls:
m_Calls: []
characterArrived:
m_PersistentCalls:
m_Calls: []
interactionComplete:
m_PersistentCalls:
m_Calls: []
switchData: {fileID: 0} switchData: {fileID: 0}

View File

@@ -450512,6 +450512,17 @@ PrefabInstance:
m_AddedGameObjects: [] m_AddedGameObjects: []
m_AddedComponents: [] m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 4b7426bc1f8736749b68973653f4dbfb, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 4b7426bc1f8736749b68973653f4dbfb, type: 3}
--- !u!114 &1101333110 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 3660460661744729199, guid: 4b7426bc1f8736749b68973653f4dbfb, type: 3}
m_PrefabInstance: {fileID: 1101333109}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4ad080e6ca3114e4e96ccc33655d3dff, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &1106104746 --- !u!1 &1106104746
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -472334,6 +472345,66 @@ PrefabInstance:
propertyPath: characterToInteract propertyPath: characterToInteract
value: 1 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 1126777572448403549, guid: 1fda7fccaa5fbd04695f4c98d29bcbe0, type: 3}
propertyPath: characterArrived.m_PersistentCalls.m_Calls.Array.size
value: 2
objectReference: {fileID: 0}
- target: {fileID: 1126777572448403549, guid: 1fda7fccaa5fbd04695f4c98d29bcbe0, type: 3}
propertyPath: characterArrived.m_PersistentCalls.m_Calls.Array.data[0].m_Mode
value: 5
objectReference: {fileID: 0}
- target: {fileID: 1126777572448403549, guid: 1fda7fccaa5fbd04695f4c98d29bcbe0, type: 3}
propertyPath: characterArrived.m_PersistentCalls.m_Calls.Array.data[1].m_Mode
value: 5
objectReference: {fileID: 0}
- target: {fileID: 1126777572448403549, guid: 1fda7fccaa5fbd04695f4c98d29bcbe0, type: 3}
propertyPath: characterArrived.m_PersistentCalls.m_Calls.Array.data[0].m_Target
value:
objectReference: {fileID: 1101333110}
- target: {fileID: 1126777572448403549, guid: 1fda7fccaa5fbd04695f4c98d29bcbe0, type: 3}
propertyPath: characterArrived.m_PersistentCalls.m_Calls.Array.data[1].m_Target
value:
objectReference: {fileID: 4912039252317080711}
- target: {fileID: 1126777572448403549, guid: 1fda7fccaa5fbd04695f4c98d29bcbe0, type: 3}
propertyPath: characterArrived.m_PersistentCalls.m_Calls.Array.data[0].m_CallState
value: 2
objectReference: {fileID: 0}
- target: {fileID: 1126777572448403549, guid: 1fda7fccaa5fbd04695f4c98d29bcbe0, type: 3}
propertyPath: characterArrived.m_PersistentCalls.m_Calls.Array.data[1].m_CallState
value: 2
objectReference: {fileID: 0}
- target: {fileID: 1126777572448403549, guid: 1fda7fccaa5fbd04695f4c98d29bcbe0, type: 3}
propertyPath: characterArrived.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName
value: stateSwitch
objectReference: {fileID: 0}
- target: {fileID: 1126777572448403549, guid: 1fda7fccaa5fbd04695f4c98d29bcbe0, type: 3}
propertyPath: characterArrived.m_PersistentCalls.m_Calls.Array.data[1].m_MethodName
value: stateSwitch
objectReference: {fileID: 0}
- target: {fileID: 1126777572448403549, guid: 1fda7fccaa5fbd04695f4c98d29bcbe0, type: 3}
propertyPath: characterArrived.m_PersistentCalls.m_Calls.Array.data[0].m_TargetAssemblyTypeName
value: GardenerBehaviour, AppleHillsScripts
objectReference: {fileID: 0}
- target: {fileID: 1126777572448403549, guid: 1fda7fccaa5fbd04695f4c98d29bcbe0, type: 3}
propertyPath: characterArrived.m_PersistentCalls.m_Calls.Array.data[1].m_TargetAssemblyTypeName
value: LawnMowerBehaviour, AppleHillsScripts
objectReference: {fileID: 0}
- target: {fileID: 1126777572448403549, guid: 1fda7fccaa5fbd04695f4c98d29bcbe0, type: 3}
propertyPath: characterArrived.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_StringArgument
value: GardenerRunning
objectReference: {fileID: 0}
- target: {fileID: 1126777572448403549, guid: 1fda7fccaa5fbd04695f4c98d29bcbe0, type: 3}
propertyPath: characterArrived.m_PersistentCalls.m_Calls.Array.data[1].m_Arguments.m_StringArgument
value: LawnmowerMoving
objectReference: {fileID: 0}
- target: {fileID: 1126777572448403549, guid: 1fda7fccaa5fbd04695f4c98d29bcbe0, type: 3}
propertyPath: characterArrived.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_ObjectArgumentAssemblyTypeName
value: UnityEngine.Object, UnityEngine
objectReference: {fileID: 0}
- target: {fileID: 1126777572448403549, guid: 1fda7fccaa5fbd04695f4c98d29bcbe0, type: 3}
propertyPath: characterArrived.m_PersistentCalls.m_Calls.Array.data[1].m_Arguments.m_ObjectArgumentAssemblyTypeName
value: UnityEngine.Object, UnityEngine
objectReference: {fileID: 0}
- target: {fileID: 3485064730924644412, guid: 1fda7fccaa5fbd04695f4c98d29bcbe0, type: 3} - target: {fileID: 3485064730924644412, guid: 1fda7fccaa5fbd04695f4c98d29bcbe0, type: 3}
propertyPath: m_Name propertyPath: m_Name
value: LawnmowerStateMachine value: LawnmowerStateMachine
@@ -472387,6 +472458,17 @@ PrefabInstance:
m_AddedGameObjects: [] m_AddedGameObjects: []
m_AddedComponents: [] m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 1fda7fccaa5fbd04695f4c98d29bcbe0, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 1fda7fccaa5fbd04695f4c98d29bcbe0, type: 3}
--- !u!114 &4912039252317080711 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 3878369439964005511, guid: 1fda7fccaa5fbd04695f4c98d29bcbe0, type: 3}
m_PrefabInstance: {fileID: 4912039252317080710}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9fba2c868971b20439aaea06a939d8e7, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &5288063114372713135 --- !u!1001 &5288063114372713135
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: a8a8e3c7b61e8a64cb8299c7471c5d17
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -13,14 +13,13 @@ namespace Levels
/// <summary> /// <summary>
/// Handles level switching when interacted with. Applies switch data and triggers scene transitions. /// Handles level switching when interacted with. Applies switch data and triggers scene transitions.
/// </summary> /// </summary>
public class LevelSwitch : MonoBehaviour public class LevelSwitch : InteractableBase
{ {
/// <summary> /// <summary>
/// Data for this level switch (target scene, icon, etc). /// Data for this level switch (target scene, icon, etc).
/// </summary> /// </summary>
public LevelSwitchData switchData; public LevelSwitchData switchData;
private SpriteRenderer _iconRenderer; private SpriteRenderer _iconRenderer;
private InteractableBase _interactable;
// Settings reference // Settings reference
private IInteractionSettings _interactionSettings; private IInteractionSettings _interactionSettings;
@@ -35,11 +34,6 @@ namespace Levels
_isActive = true; _isActive = true;
if (_iconRenderer == null) if (_iconRenderer == null)
_iconRenderer = GetComponent<SpriteRenderer>(); _iconRenderer = GetComponent<SpriteRenderer>();
_interactable = GetComponent<InteractableBase>();
if (_interactable != null)
{
_interactable.characterArrived.AddListener(OnCharacterArrived);
}
// Initialize settings reference // Initialize settings reference
_interactionSettings = GameManager.GetSettingsObject<IInteractionSettings>(); _interactionSettings = GameManager.GetSettingsObject<IInteractionSettings>();
@@ -47,17 +41,6 @@ namespace Levels
ApplySwitchData(); ApplySwitchData();
} }
/// <summary>
/// Unity OnDestroy callback. Cleans up event handlers.
/// </summary>
void OnDestroy()
{
if (_interactable != null)
{
_interactable.characterArrived.RemoveListener(OnCharacterArrived);
}
}
#if UNITY_EDITOR #if UNITY_EDITOR
/// <summary> /// <summary>
/// Unity OnValidate callback. Ensures icon and data are up to date in editor. /// Unity OnValidate callback. Ensures icon and data are up to date in editor.
@@ -87,7 +70,7 @@ namespace Levels
/// <summary> /// <summary>
/// Handles the start of an interaction (shows confirmation menu and switches the level if confirmed). /// Handles the start of an interaction (shows confirmation menu and switches the level if confirmed).
/// </summary> /// </summary>
private void OnCharacterArrived() protected override void OnCharacterArrived()
{ {
if (switchData == null || string.IsNullOrEmpty(switchData.targetLevelSceneName) || !_isActive) if (switchData == null || string.IsNullOrEmpty(switchData.targetLevelSceneName) || !_isActive)
return; return;

View File

@@ -16,14 +16,13 @@ namespace Levels
/// <summary> /// <summary>
/// Handles switching into minigame levels when interacted with. Applies switch data and triggers scene transitions. /// Handles switching into minigame levels when interacted with. Applies switch data and triggers scene transitions.
/// </summary> /// </summary>
public class MinigameSwitch : MonoBehaviour public class MinigameSwitch : InteractableBase
{ {
/// <summary> /// <summary>
/// Data for this level switch (target scene, icon, etc). /// Data for this level switch (target scene, icon, etc).
/// </summary> /// </summary>
public LevelSwitchData switchData; public LevelSwitchData switchData;
private SpriteRenderer _iconRenderer; private SpriteRenderer _iconRenderer;
private InteractableBase _interactable;
// Settings reference // Settings reference
private IInteractionSettings _interactionSettings; private IInteractionSettings _interactionSettings;
@@ -41,11 +40,7 @@ namespace Levels
_isActive = true; _isActive = true;
if (_iconRenderer == null) if (_iconRenderer == null)
_iconRenderer = GetComponent<SpriteRenderer>(); _iconRenderer = GetComponent<SpriteRenderer>();
_interactable = GetComponent<InteractableBase>();
if (_interactable != null)
{
_interactable.characterArrived.AddListener(OnCharacterArrived);
}
// Initialize settings reference // Initialize settings reference
_interactionSettings = GameManager.GetSettingsObject<IInteractionSettings>(); _interactionSettings = GameManager.GetSettingsObject<IInteractionSettings>();
ApplySwitchData(); ApplySwitchData();
@@ -66,11 +61,6 @@ namespace Levels
private void OnDestroy() private void OnDestroy()
{ {
PuzzleManager.Instance.OnAllPuzzlesComplete -= HandleAllPuzzlesComplete;
if (_interactable != null)
{
_interactable.characterArrived.RemoveListener(OnCharacterArrived);
}
if (SaveLoadManager.Instance != null) if (SaveLoadManager.Instance != null)
{ {
SaveLoadManager.Instance.OnLoadCompleted -= OnSaveDataLoadedHandler; SaveLoadManager.Instance.OnLoadCompleted -= OnSaveDataLoadedHandler;
@@ -142,7 +132,7 @@ namespace Levels
/// <summary> /// <summary>
/// Handles the start of an interaction (shows confirmation menu and switches the level if confirmed). /// Handles the start of an interaction (shows confirmation menu and switches the level if confirmed).
/// </summary> /// </summary>
private void OnCharacterArrived() protected override void OnCharacterArrived()
{ {
if (switchData == null || string.IsNullOrEmpty(switchData.targetLevelSceneName) || !_isActive) if (switchData == null || string.IsNullOrEmpty(switchData.targetLevelSceneName) || !_isActive)
return; return;