private void InitializeIfNeeded() { if (_mapCreationBehaviour == null) { _mapCreationBehaviour = GameObject.FindObjectOfType <MapCreationBehaviour>(); } if (_playerRepresentation == null) { _playerRepresentation = new GameObject("Player"); _playerRepresentation.AddComponent <AudioListener>(); _currentPosition = _mapCreationBehaviour.startPositionIJ; MoveRepresetnation(); } }
public void Dispose() { GameObject.Destroy(_playerRepresentation); _mapCreationBehaviour = null; }