Comments (5)
Hi,
Edited your message for better readability.
Could you please say, in what situation you encountered the error? A list of steps to reproduce it would be great.
I have to say, I will probably not have much free time at the moment to debug this project, but I'll try to help. If you happen to find a fix yourself, PRs are welcome!
Thanks!
from deckswipe.
Hi , Thank you .
First I downloaded from Github
I tried to open it with Unity 2019.2.12
I fixed GoogleSheet api and i try only run this codes.
GoogleSheet and Card model okey because its says 200. But then i see
NullReferenceException: Object reference not set to an instance of an object
DeckSwipe.Gamestate.GameProgress.AttachReferences (DeckSwipe.Gamestate.CardStorage cardStorage) (at Assets/DeckSwipe/Gamestate/GameProgress.cs:24)
Thanks
from deckswipe.
I think I have identified the problem.
You've only just started working with the project, so, most likely, you don't have the progress persistence file yet. The game attempts to locate the file at Application.persistentDataPath + "/progress.json"
. On Linux, that's ~/.config/unity3d/GruzWorks/DeckSwipe/progress.json
. On Windows, it's going to be somewhere under AppData
in your user directory.
That is perfectly normal, and the expected behaviour is that the game would just create a new, fresh GameProgress
structure for you, and then save it whenever it would usually save your progress.
However, I missed a detail in the implementation. When the file doesn't exist, ProgressStorage
gets a null
from await LoadLocally();
on this line. It then notices that, and creates a new GameProgress
. The next step is to call AttachReferences()
on it. At the very beginning of that method, we try iterating over a list:
public void AttachReferences(CardStorage cardStorage) {
foreach (CardProgress entry in cardProgress) {
But we haven't initialised that list! So foreach
wants to get an iterator from a list object that doesn't exist.
What's missing is a default constructor for GameProgress
that would initialise the lists, or a = new List<...>()
in the declaration of each. This is a very simple fix, so if you want to, you're more than welcome to fork the repository, implement the fix, and submit a pull request. If not, I'll probably provide the fix myself, but it might take longer until it's available, because I'm a bit busy.
Thank you for the report!
from deckswipe.
Hi,
Was there a fix provided for this by chance? I'm a novice here; managed to get through the Google API items, but stuck at this step without technical acumen to implement solution from scratch. Any more pointers? Thank you.
from deckswipe.
I have just pushed the fix, in commit f2c0388. The project should run out of the box now.
from deckswipe.
Related Issues (20)
- Ingame date can be advanced without actually playing the game
- Code cleanup HOT 1
- Animate deck drop/shuffle at game start
- Rename stats
- Put current gameplay progress on the game UI
- Create menu screen
- Replace text font HOT 1
- Replace placeholder card sprite
- Separate special cards from regular cards in model
- Change API key supply method
- [GoogleSheetsImporter] Request failed HOT 3
- Problem with GoogleSheetsImporter using Windows HOT 4
- Special letter
- How to use card prerequisites? HOT 3
- Update README
- Create alternative way to supply card data
- Switch to Unity's new Input System HOT 2
- Visual preview of action outcome HOT 2
- Eliminate need for dummy cards
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deckswipe.