diff --git a/Assets/Scripts/Interactables/LightSwitchView.cs b/Assets/Scripts/Interactables/LightSwitchView.cs index e96c6032..894d5eed 100644 --- a/Assets/Scripts/Interactables/LightSwitchView.cs +++ b/Assets/Scripts/Interactables/LightSwitchView.cs @@ -1,21 +1,22 @@ using System.Collections.Generic; using UnityEngine; +using System; using static LightSwitchView; public class LightSwitchView : MonoBehaviour, IInteractable { [SerializeField] private List lightsources = new List(); private SwitchState currentState; - public delegate void LightSwitchDelegate(); - public static LightSwitchDelegate lightToggled; - private void OnEnable() => lightToggled += onLightSwitch; + public static event Action lightToggledAction; - private void OnDisable() => lightToggled -= onLightSwitch; + private void OnEnable() => lightToggledAction += onLightSwitch; + + private void OnDisable() => lightToggledAction -= onLightSwitch; private void Start() => currentState = SwitchState.Off; - public void Interact() => lightToggled?.Invoke(); + public void Interact() => lightToggledAction?.Invoke(); private void toggleLights() { diff --git a/Assets/Scripts/Player/PlayerController.cs b/Assets/Scripts/Player/PlayerController.cs index 054fc215..bd0e4bd6 100644 --- a/Assets/Scripts/Player/PlayerController.cs +++ b/Assets/Scripts/Player/PlayerController.cs @@ -25,13 +25,13 @@ public PlayerController(PlayerView playerView, PlayerScriptableObject playerScri this.playerScriptableObject = playerScriptableObject; this.playerScriptableObject.KeysEquipped = 0; - LightSwitchView.lightToggled += onLightSwitch; + LightSwitchView.lightToggledAction += onLightSwitch; playerState = PlayerState.InDark; } ~PlayerController() { - LightSwitchView.lightToggled -= onLightSwitch; + LightSwitchView.lightToggledAction -= onLightSwitch; } public void Interact() => IsInteracted = Input.GetKeyDown(KeyCode.E) ? true : (Input.GetKeyUp(KeyCode.E) ? false : IsInteracted); diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index 3d6c323f..a7a5887e 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -72,13 +72,13 @@ "depth": 0, "source": "builtin", "dependencies": { - "com.unity.ide.visualstudio": "2.0.17", - "com.unity.ide.rider": "3.0.18", + "com.unity.ide.visualstudio": "2.0.16", + "com.unity.ide.rider": "3.0.15", "com.unity.ide.vscode": "1.2.5", "com.unity.editorcoroutines": "1.0.0", - "com.unity.performance.profile-analyzer": "1.2.2", + "com.unity.performance.profile-analyzer": "1.1.1", "com.unity.test-framework": "1.1.31", - "com.unity.testtools.codecoverage": "1.2.2" + "com.unity.testtools.codecoverage": "1.0.1" } }, "com.unity.ide.rider": { @@ -114,7 +114,7 @@ "url": "https://packages.unity.com" }, "com.unity.performance.profile-analyzer": { - "version": "1.2.2", + "version": "1.1.1", "depth": 1, "source": "registry", "dependencies": {}, @@ -139,7 +139,7 @@ "url": "https://packages.unity.com" }, "com.unity.testtools.codecoverage": { - "version": "1.2.2", + "version": "1.0.1", "depth": 1, "source": "registry", "dependencies": { diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt index bca3d022..1f883d75 100644 --- a/ProjectSettings/ProjectVersion.txt +++ b/ProjectSettings/ProjectVersion.txt @@ -1,2 +1,2 @@ -m_EditorVersion: 2021.3.21f1 -m_EditorVersionWithRevision: 2021.3.21f1 (1b156197d683) +m_EditorVersion: 2021.3.10f1 +m_EditorVersionWithRevision: 2021.3.10f1 (1c7d0df0160b)