DI / IoC using PUN

Options
Hello everybody,

I was wondering if it is possible to use Photon with any IoC Framework (i.e. Zenject) when it comes to the Photon initialisiation?

Does anybody has expirience in using these two packages?

I really would love to have an IoC Framework in my PUN-based project.

Thx

Best Answer

Answers

  • Bunzaga
    Options
    I'm using StrangeIOC with PUN, however we've come up with our own 'StrangePackage' system, which is similar, but a little different than the typical Context architecture. It works great though. I basically just have a class that implements IPunCallbacks, and for each callback I want to listen to, I have a signal that dispatches with any data needed, for example:
    public void OnPhotonPlayerConnected(PhotonPlayer newPlayer)
    {
        PhotonPlayerConnectedSignal.Dispatch(newPlayer);
    }
    Then if I need a command, I just bind that to the signal, or I just addListener to it if it is one of those fire and forget signals.
  • ChaosHelme
    Options
    Hey Bunzaga thanks for the answer.

    The problem we're seeing in StrangeIoC is the combability. According to the GitHub page it's not running on Xbox One and PS4. Our game is suppose to be released on these plattforms as well.
  • ChaosHelme
    Options
    Thanks :)