heroiclabs / unity-sampleproject

A sample game called Pirate Panic for Unity engine built with Nakama server.
https://heroiclabs.com
Apache License 2.0
141 stars 40 forks source link

Game doesn't run on Windows #17

Closed tomglenn closed 3 years ago

tomglenn commented 3 years ago

There appears to be an issue stopping the project from working on Windows platforms.

NullReferenceException: Object reference not set to an instance of an object
  at PiratePanic.Hand.DrawCard () [0x00001] in D:\Heroic Labs\projects\unity-sampleproject\PiratePanic\Assets\PiratePanic\Scripts\Menus\Battle\Hand\Hand.cs:91 

Full log file attached.

Have spoke to @lugehorsam and does not appear to happen on OS X.

Host.log

EricSkea commented 3 years ago

I encounter this on macOS 11.4 (tested with Unity 2020.3.11f1, Nakama 3.3.0)

novabyte commented 3 years ago

@lugehorsam and @tomglenn can you take a look at this and resolve this issue. Thanks 🙏

lugehorsam commented 3 years ago

@EricSkea I've resolved this in the latest commit. You will need to clear your player preferences after pulling. These preferences reside in a location that depends on your platform:

https://docs.unity3d.com/ScriptReference/PlayerPrefs.html

EricSkea commented 3 years ago

Awesome, working now thanks. On the subject of player preferences I had to change the bundle ID, build for macOS desktop, then change it back before running in-editor (otherwise in-editor and built app both used the same plist, which seemed to cause no cards on the desktop build).

lugehorsam commented 3 years ago

@EricSkea thanks for the note. I'll update the readme noting that for MacOS users.