Mazyod / PhoenixSharp

C# Phoenix Channels client. Unity Compatible.
MIT License
163 stars 27 forks source link

How to use it with unity3D #15

Closed LordOkami closed 5 years ago

LordOkami commented 5 years ago

Hi, I'm trying to use the library with Unity3D and I'm having multiple compilation errors, do you have an example proyect in unity to get started with your library?

Thanks in advance

Shivang44 commented 5 years ago

I'm having multiple compilation errors

Can you output the errors? One thing I did was delete anything inside vendor that was causing a compilation error (BestHTTP folder, NUnit, Nsubstitute). After that I didn't have any errors.

Mazyod commented 5 years ago

I personally add this project as a submodule to my Unity project repo under Vendor folder, and then use this script to copy specific files into the Unity Assets folder:

#!/usr/local/bin/python3

import shutil
import os

src_dir = "./Vendor/PhoenixSharp/Phoenix"
dst_dir = "./KoD-Unity/Assets/Vendor/PhoenixSharp/"
files = filter(lambda f: f.endswith(".cs"), os.listdir(src_dir))
files = map(lambda f: os.path.join(src_dir, f), files)

for f in files:
    shutil.copy(f, dst_dir)
LordOkami commented 5 years ago

Thank you for your fast response! :), I'm afraid I'm doing wrong, I'm a total newbie in Unity and C#, I've just copied the folder PhoenixSharp into my proyect: image And there are the errors on the console: image

I'll try to add the proyect as submodule and run your script to copy the files, thanks a million :)

LordOkami commented 5 years ago

Finally I've a socket connection working.

Thanks for your help! :)