Пример #1
0
    private void CacheLoadLocations(GameSceneSO[] locationsToLoad, bool showLoadingScreen)
    {
        LocationSO locationSo = locationsToLoad[0] as LocationSO;

        if (locationSo)
        {
            saveData._locationId = locationSo.DescId.uuid;
        }
    }
Пример #2
0
    private void CacheLoadLocations(GameSceneSO locationsToLoad, bool showLoadingScreen)
    {
        LocationSO locationSO = locationsToLoad as LocationSO;

        if (locationSO)
        {
            saveData._locationId = locationSO.Guid;
        }

        SaveDataToDisk();
    }
Пример #3
0
    public void Teleport(LocationSO where, PathSO whichEntrance)
    {
        //Avoid reloading the same Location, which would result in an error
        if (where == _lastLocationTeleportedTo)
        {
            return;
        }

        _path.lastPathTaken       = whichEntrance;
        _lastLocationTeleportedTo = where;
        _loadLocationRequest.RaiseEvent(where);
    }
Пример #4
0
    IEnumerator LoadSaveGame()
    {
        yield return(StartCoroutine(_saveSystem.LoadSavedInventory()));

        var locationGuid         = _saveSystem.saveData._locationId;
        var asyncOperationHandle = Addressables.LoadAssetAsync <LocationSO>(locationGuid);

        yield return(asyncOperationHandle);

        if (asyncOperationHandle.Status == AsyncOperationStatus.Succeeded)
        {
            LocationSO locationSO = asyncOperationHandle.Result;
            _startGameEvent.RaiseEvent(locationSO, _showLoadScreen);
        }
    }
Пример #5
0
    // ------------------------------------------------------------------------
    public void OpenLocation(LocationSO locationSO, Transform target)
    {
        if (_zoomIn || _zoomOut)
        {
            return;
        }

        Vector3 targetDistance = transform.position - target.position;

        _moveSpeed     = targetDistance / CameraZoomDuration;
        _moveSpeed.z   = 0;
        ActiveLocation = locationSO;
        //StartCameraZoom();
        _selectedSprite = target;
        Debug.Log(_selectedSprite);
        ScaleAndMoveLocation();
        DisableMapIcons();
    }