ClientRpc
Description
注册客户端远程操作接收器以监听客户端rpc事件。ClientRpc调用从服务器上的一个对象发送到客户端的一个对象。它们可以从任何具有生成的NetworkIdentity的服务器对象发送。因为服务器有权限,所以服务器对象能够发送这些调用没有安全问题。
Events
public Dictionary<string, Action<string, NetworkIdentity>> ClientRpcStringAction;
public Dictionary<string, Action<float, NetworkIdentity>> ClientRpcFloatAction;
public Dictionary<string, Action<int, NetworkIdentity>> ClientRpcIntAction;
public Dictionary<string, Action<bool, NetworkIdentity>> ClientRpcBoolAction;
public Dictionary<string, Action<Vector3, NetworkIdentity>> ClientRpcVector3Action;
public Dictionary<string, Action<Quaternion, NetworkIdentity>> ClientRpcQuaternionAction;
public Dictionary<string, Action<GameObject, NetworkIdentity>> ClientRpcGameObjectAction;
public Dictionary<string, Action<TransformData, NetworkIdentity>> ClientRpcTransformDataAction;
public Dictionary<string, Action<NetworkIdentity>> ClientRpcAction;
Parameters
Name | Type | Description |
---|---|---|
_eventName | string | Key of event dictnary |
_parameter | Int/Float/String/Bool/TransformData/Vector3/Quaternion/NetkGameObject | Incomming data |
_sender | NetworkIdentity | Who sent this remote action |
Methods
信息
There have None,Int,Float,String,Vector3,Quaternion,GameObject(NetworkGameObject),TransformData.
Client Rpc Trigger
public void ClientRpcSender(string _eventName, NetworkIdentity _sender);
public void ClientRpcStringSender(string _eventName, string _parameter, NetworkIdentity _sender);
public void ClientRpcFloatSender(string _eventName, float _parameter, NetworkIdentity _sender);
public void ClientRpcIntSender(string _eventName, int _parameter, NetworkIdentity _sender);
public void ClientRpcBoolSender(string _eventName, bool _parameter, NetworkIdentity _sender);
public void ClientRpcVector3Sender(string _eventName, Vector3 _parameter, NetworkIdentity _sender);
public void ClientRpcQuaternionSender(string _eventName, Quaternion _parameter, NetworkIdentity _sender);
public void ClientRpcGameObjectSender(string _eventName, GameObject _parameter, NetworkIdentity _sender);
public void ClientRpcTransformDataSender(string _eventName, TransformData _parameter, NetworkIdentity _sender);