Пример #1
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        var player = collision.GetComponent <Player>();

        if (player != null)
        {
            SavedataManager.SaveLastPosition(_nextScene_startPos);
            SavedataManager.SaveIsWarped(true);
            SceneManager.LoadScene(_nextSceneName);
            player.transform.localPosition = _nextScene_startPos;
        }
    }
Пример #2
0
    private void SavePosition(Vector3 position)
    {
        var fixedPosition = new Vector3(position.x, position.y, 0);

        SavedataManager.SaveLastPosition(fixedPosition);
    }