コード例 #1
0
ファイル: NetworkAdapter.cs プロジェクト: smoi23/sandbox
 //!
 //! Called from spawned players when client is connected and after ownership message from server arrived
 //!
 public void RegisterPlayer(NetworkPlayerBase player)
 {
     if (userNotPresent)
     {
         userNotPresent.SetActive(false);
     }
     player.OnPlayerRestingChanged.AddListener(handlePlayerResting);
 }
コード例 #2
0
ファイル: NetworkAdapter.cs プロジェクト: smoi23/sandbox
 //!
 //! On all spawned players call ForceRotation
 //! TODO make a generic function
 //! @param		rot		rotation to be set
 //!
 public void RpcCallToAll(Quaternion rot)
 {
     foreach (KeyValuePair <NetworkInstanceId, NetworkIdentity> pair in NetworkServer.objects)
     {
         if (pair.Value.gameObject != null)
         {
             NetworkPlayerBase player = pair.Value.gameObject.GetComponent <NetworkPlayerBase>();
             if (player != null)
             {
                 player.ForceRotationOnClient(rot);
             }
         }
     }
 }