Forum Scripting PlayerIO.UnityInit

Post your problems and discussions relating to scripting in Unity here.

PlayerIO.UnityInit

Postby NPSF3000 » September 27th, 2011, 5:00 am

What does PlayerIO.UnityInit do?

Particularly interested because I want to know if the need for it would interfere with having multiple scripts- each with one or more clients?
NPSF3000
 
Posts: 41
Joined: March 17th, 2010, 11:14 am

Re: PlayerIO.UnityInit

Postby NPSF3000 » October 3rd, 2011, 4:16 am

Bump.
NPSF3000
 
Posts: 41
Joined: March 17th, 2010, 11:14 am

Re: PlayerIO.UnityInit

Postby Oliver » October 12th, 2011, 12:45 pm

The summery of the method says:

/// <summary>
/// Setup the Player.IO Client to use the referenced behaviour (script) to interact with Unity.
/// </summary>

In essence, you need to give the PlayerIO client a mono behavior that it can use to interact with Unity and perform webservice calls with. You only need to call it once with a behavior that's always accessible.

Best,
Oliver
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am

Re: PlayerIO.UnityInit

Postby NPSF3000 » October 12th, 2011, 12:57 pm

Oliver wrote:The summery of the method says:

/// <summary>
/// Setup the Player.IO Client to use the referenced behaviour (script) to interact with Unity.
/// </summary>

In essence, you need to give the PlayerIO client a mono behavior that it can use to interact with Unity and perform webservice calls with. You only need to call it once with a behavior that's always accessible.

Best,
Oliver


Ahh... so what I need to do is simply create a dummy behavior so that the client can work - not register every script.

Gotcha.

Edit: Awesome to see some staff back on the forums - I was getting very scared :(
Last edited by NPSF3000 on October 12th, 2011, 1:03 pm, edited 1 time in total.
NPSF3000
 
Posts: 41
Joined: March 17th, 2010, 11:14 am

Re: PlayerIO.UnityInit

Postby Oliver » October 12th, 2011, 1:03 pm

Yea..

The client just needs a reference to something that it can use to perform web requests and schedule the running of code with, since the normal .NET methods to do these things aren't allowed inside the Unity sandbox.
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am


Return to Scripting



cron