Inregards to CJRGaming video series, need client help!

Options
ZZyrex
edited September 2014 in DotNet
I've been following CJRgaming video series posted on the forum! It was very helpful in that I can understand the server side. My only issue is - I don't understand what a unity game object compares to in regular C# so I'm struggling to figure out how to configure a client to work with the client framework he's built. My only real issue is, that I don't understand what I need to do to instantiate the application. In the video (episode 7+). He does the following:
  • Codes the C# Class Library
  • Opens Unity
  • Sets the variables inside unitys GUI (which I don't understand where it is applying the variables)
  • And hits play in Unity
Obviously I can't run this, because you can't run a class library - fair enough! I'm just stuck on how do I implement this into a regular C# client? Unity seems to do a fair amount of the work in this regard.

I know this may not be the best place to post but I figured it's still photon related so maybe someone has had some experience with this!

Comments

  • vadim
    Options
    Hi,

    Hitting play in unity runs application with current scene. You can add components (C# classes) to objects in scene. Public members of these components exposed in Unity editor gui.
  • Oh I see! The framework I'll be using has an incomplete GUI code(Otter) so I'll have to just use C# default! As for the function to call, I'm a little lost I believe the way Unity can start up is that because it inherits from "Monobehaviour" a particular method pattern is starting up the application and I'm not sure what the starting point is in this application (I have tried instantiating the "start()" command xD) but it didn't really work?

    Have you seen the series? Could you just point me in right direction!

    Thanks!
  • vadim
    Options
    You did not provide a link to the tutorial, so I had no chance to see it.
    Did you succeed with other tutorials? Are basic Unity concepts clear for you?
  • My apologies thought I did link it! https://www.youtube.com/watch?v=AyuSbW3CoJU to https://www.youtube.com/watch?v=G2PXMxnA0zQ.

    Now I don't expect you to watch all of it, I haven't been able to find other tutorial as in-depth as this one as a whole the rest of the episodes which work on the server side I understood perfectly as they are pure C#. I have no knowledge of Unity, which is another reason why I'm not using it and I'm just lost on how to get the client even started in a regular Windows form application a simple SendPacket() to server would be a huge step xD
  • Tobias
    Options
    I'm not sure if this is feasible for what you want to do but in my opinion it might be easier to drop everything Unity-related and begin from scratch.
    As you already said, Unity adds a fair amount of components and classes and might be more difficult to re-implement in Windows Forms than to start over without that "burden".
    Use RaiseEvent and decide freely what you need to send, how and when.

    To help you better, maybe you can explain a bit:
    Why can't you run a class library?
    What is your goal in this project?
    Why Windows Forms?
  • Well the server-side code has no unity link to it whatsoever which is fine, and the client-side framework has a couple of unity related things like having to extend monobehaviour, debugging and scene loading. Which I have found/redone an alternative solution and can compile the library with no errors at all, I started watching the series because I didn't understand how to work with photon and it was a tutorial series which was rich in content so that's why I started the whole thing as it is a pretty good foundation for it all and it is, I do feel like I understand it a lot more :D

    Why can't you run a class library?
    C# doesn't physically let you build a class library, as it is a library. It is meant to be implemented in a project which expands it :P

    What is your goal in this project?
    Well the tutorial series, is to give a good understanding of using photon and a good foundation and Christian explains the reasons why he does stuff and they do seem very legitimate reasons. Obviously I want to extend this further into a personal project but for now I'm just trying to grasp an understanding on how everything works. Plus an MVC design is always nice!

    Why Windows Forms?
    I'm not sure what you mean by this question, it is not entirely important just a platform to run it in. As Unity compiles everything into a GUI for you; presumably through the GUI code it has built in - Windows forms would be my way to building a GUI application.

    I guess a good step would be to figuring out how unity applications are loaded by default and I can look at those methods inside of the framework and go from there!