[Interaction] Zip up edge cases, base for interactions is now done
This commit is contained in:
@@ -12,14 +12,12 @@ public class LevelSwitch : MonoBehaviour
|
||||
void Awake()
|
||||
{
|
||||
_isActive = true;
|
||||
|
||||
if (iconRenderer == null)
|
||||
iconRenderer = GetComponent<SpriteRenderer>();
|
||||
|
||||
interactable = GetComponent<Interactable>();
|
||||
if (interactable != null)
|
||||
{
|
||||
interactable.Interacted += OnInteracted;
|
||||
interactable.StartedInteraction += OnStartedInteraction;
|
||||
}
|
||||
ApplySwitchData();
|
||||
}
|
||||
@@ -28,7 +26,7 @@ public class LevelSwitch : MonoBehaviour
|
||||
{
|
||||
if (interactable != null)
|
||||
{
|
||||
interactable.Interacted -= OnInteracted;
|
||||
interactable.StartedInteraction -= OnStartedInteraction;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +50,7 @@ public class LevelSwitch : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
private async void OnInteracted()
|
||||
private async void OnStartedInteraction()
|
||||
{
|
||||
Debug.Log($"LevelSwitch.OnInteracted: Switching to level {switchData?.targetLevelSceneName}");
|
||||
if (switchData != null && !string.IsNullOrEmpty(switchData.targetLevelSceneName) && _isActive)
|
||||
|
||||
Reference in New Issue
Block a user