こんにちは。ヤマヤタケシです。
ネットワークの両方でテロップを出そうとしました。
@RPC
function Terop( terop_name )
{
Debug.Log( terop_name );
}
function Update()
{
if( Input.GetButtonDown( "Fire1" ) ){
networkView.RPC( "Terop", RPCMode.AllBuffered, "abcdefg" );
}
}
しかし、こんなエラーが!
- Sending RPC failed because ‘Terop’ parameter 0 didn’t match the RPC declaration. Expected ‘System.Object’ but got ‘System.String’ UnityEngine.NetworkView:RPC(String, RPCMode, Object[]) *
なるほど
エラーメッセージをよく読むと、RPCの説明が違うってことか??? あぁ、型も書けってことね。
修正した
@RPC
function Terop( terop_name : String )
{
Debug.Log( terop_name );
}
そんじゃまた。
