RemoveInstantiatedGO() protected méthode

Removes GameObject and the PhotonViews on it from local lists and optionally updates remotes. GameObject gets destroyed at end.
This method might fail and quit early due to several tests.
protected RemoveInstantiatedGO ( GameObject go, bool localOnly ) : void
go GameObject GameObject to cleanup.
localOnly bool For localOnly, tests of control are skipped and the server is not updated.
Résultat void
Exemple #1
0
 public static void Destroy(PhotonView targetView)
 {
     if (targetView != null)
     {
         networkingPeer.RemoveInstantiatedGO(targetView.gameObject, !inRoom);
     }
     else
     {
         Debug.LogError("Destroy(targetPhotonView) failed, cause targetPhotonView is null.");
     }
 }
Exemple #2
0
 /// <summary>
 /// Destroys given GameObject. Requires it to have photonview(s) attached.
 /// </summary>
 /// <param name="go"></param>
 public static void Destroy(GameObject go)
 {
     networkingPeer.RemoveInstantiatedGO(go);
 }