-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better Guides #21
Comments
@Mazyod I'm attempting to integrate the library and running into some trouble figuring it out. Is there any way you could help me resolve some of the issues I'm having with integrating this into my Unity project? I attempted to build a dll, but I get an assembly error: When I attempt to import the source code manually I run into other assembly reference errors: I believe I've properly set my project to .NET 4.x I'm assuming there is some small but essential point that I missed during the setup. I was able to successfully run the unit tests. Thanks in advance @Mazyod I really appreciate the work you have done on this repo! |
Hey @ekrenzin 👋, I'm going to try importing the code into a fresh project with the settings you've shared. Meanwhile, could you please share the Unity version you're using? Perhaps also the Target platform would be helpful, although I'm guessing it's macOS. |
@Mazyod Thanks for the fast response! I'm building a VR application, so the target platform is windows & android. I created a fresh 3d project to test/confirm that I hadn't accidentally changed a setting, but I ended up with the same results. To be transparent, I'm quite new to unity and c#. It's not unlikely that there is a basic essential concept that I am unaware of. I'm working on a windows 11 machine - but I could switch to either windows 10 or a m1 mac if that would make a difference. For importing the source code, the most confusing error to me is Similarly, when adding the dll as a plugin it almost seems like
Here is the build logs from building PhoenixSharp with Rider: (2 warnings but a dll is created) Let me know if there is any other information I can give that might be helpful. Thanks again! |
I should’ve guessed Windows from the file paths 😅 .. It’s great that you are willing to share your experience! With so much details too. I’ve created this issue about docs specifically because others had trouble integrating the library, but only mentioned it on social media without details. So .. Regarding the issue, I will have time later today. I will look into the stuff you shared in detail, and prepare a windows environment from my side. You definitely shouldn’t have to switch OSs, as this library’s main goal is portability! |
Hey @ekrenzin, I pushed an update that I hope will solve your issue. I didn't have time to test it, just confirmed it compiles in the following environment:
Let me know how it goes, and if there is anything else that needs attention. I plan to test it more once I get the time. What Changed?I've been testing the library with Unity 2022.x, which reached LTS status just weeks back, and it has better support for the latest C# features and API compatibility. It is not reasonable to ask users to upgrade in order to use the library, so using higher compatibility API (lower standard version) was the way to go. The project now is based on the .NET Standard 2.0, which should be highly compatible with the largest number of platforms and Unity versions. All APIs have been accommodated to that standard level. What about .NET 4.x?According to the Unity docs, .NET 4.x should be even more compatible than .NET Standard 2.0, however, I couldn't get it to work locally. I believe it has to do with the I didn't bother research it in detail, because users should use .NET Standard 2.0 when possible, and if they needed .NET 4.x, it means they would probably know how to link the additional assemblies. (This is just an assumption from my side) |
@Mazyod Thank you so much for this update! I was finally able to get a socket open, and I'm so excited! I really appreciate how fast you implemented the compatibility changes, you are a hero! |
@Rotcline Hey 👋 Sorry for the late reply. The server for integration tests was down, but now it's up again. I suspect that's the reason for the test failure. |
@Mazyod thank you I had trouble with the tests but now is working just fine with my own server |
@Mazyod Hello! I'm having some difficulty installing the repo into a blank Unity project. Below is the version of Unity and the approach I have used to install the deps: Version of Unity
|
Sorry about the suboptimal experience with integrating the library, @ChristopherKRad. Happy to help you through this. I might guess that the error dump you're seeing is probably due to a misconfiguration and/or unnecessary files included in the project. Can you please share a few errors for me to assess? Otherwise, here is what I did to get the project working on the Unity 2020.3.47 release:
Although, I noticed NUnit being there in the project, without me adding it explicitly somehow. |
I appreciate the swift response @Mazyod :) It's not suboptimal, it's likely due to my lack of familiarity with Unity. I have a phoenix live view project which is printing "{url: www.example.com}" every 5 seconds and is deployed via fly.io I've created a sample repo to show what my Assets directory looks like (assume I have the Newtonsoft dependency loaded via the package manager, and am using the example WebSocketSharp and JsonMessageSerializer provided). Based on my limited understanding, the message should print in the unity console when I hit play, but maybe there's something missing? I'd appreciate you taking a look at the repo I've created below, and letting me know if there's something I need to change on |
@ChristopherKRad Also, make sure that you rename the main MonoBehavior script to I did that then was seeing error logs popup in the console. The errors were related to the set up and communicating with Phoenix LiveView perhaps, so you might have better luck there. |
I think the library is missing detailed guides to help developers more easily integrate the library with their project. Need to fix that.
The text was updated successfully, but these errors were encountered: