public void Dispose() { fetchScenesHandler.OnScenesFetched -= OnScenesFetched; userPositionHandler.OnPlayerCoordsChanged -= OnPlayerCoordsChanged; CommonScriptableObjects.rendererState.OnChange -= OnRenderStateChanged; fetchScenesHandler.Dispose(); markersHandler.Dispose(); userPositionHandler.Dispose(); }
public void PlayerPositionShouldSetCorrectly() { Vector2Int FIRST_POSITION = new Vector2Int(0, 0); Vector2Int SECOND_POSITION = new Vector2Int(70, -135); Vector2Int THIRD_POSITION = new Vector2Int(-34, -495); UserPositionHandler handler = new UserPositionHandler(); CommonScriptableObjects.playerCoords.Set(FIRST_POSITION); Assert.AreEqual(FIRST_POSITION, handler.playerCoords); CommonScriptableObjects.playerCoords.Set(SECOND_POSITION); Assert.AreEqual(SECOND_POSITION, handler.playerCoords); CommonScriptableObjects.playerCoords.Set(THIRD_POSITION); Assert.AreEqual(THIRD_POSITION, handler.playerCoords); handler.Dispose(); }