Quantcast
Channel: Multiplayer
Viewing all articles
Browse latest Browse all 16796

How to: Pass booleans through RPC

$
0
0
First of all, yes, I know that RPC's are outdated but personally I like the legacy system more.

So I found a way to pass booleans through RPC easily (without int or other).

in JS you would do something like this

var myBool : boolean;

function Start(){
var nView = GetComponent.<NetworkView>();
nView.RPC("MyFunc", RPCMode.AllBuffered, myBool.ToString());
}

@RPC
function MyFunc(b : String){
if(b == true.ToString()){
//true would go here
}
else{
//false here
}...

How to: Pass booleans through RPC

Viewing all articles
Browse latest Browse all 16796

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>