PhotonNetwork.UnAllocateViewID C# (CSharp) Method

UnAllocateViewID() public static method

Unregister a viewID (of manually instantiated and destroyed networked objects).
public static UnAllocateViewID ( int viewID ) : void
viewID int A viewID manually allocated by this player.
return void
    public static void UnAllocateViewID(int viewID)
    {
        manuallyAllocatedViewIds.Remove(viewID);

        if (networkingPeer.photonViewList.ContainsKey(viewID))
        {
            Debug.LogWarning(string.Format("Unallocated manually used viewID: {0} but found it used still in a PhotonView: {1}", viewID, networkingPeer.photonViewList[viewID]));
        }
    }

Usage Example

Ejemplo n.º 1
0
        private void HandleLocalDestroyLogic(GameObject go)
        {
            if (go != null)
            {
                for (int i = 0; i < go.transform.childCount; i++)
                {
                    HandleLocalDestroyLogic(go.transform.GetChild(i).gameObject);
                }

                PhotonView view = go.GetComponent <PhotonView>();
                if (view != null)
                {
                    // Clear up the local view and delete it from the registration list
                    //PhotonNetwork.networkingPeer.LocalCleanPhotonView(view);

                    view.removedFromLocalViewList = true;
                    int viewID = view.viewID;
                    PhotonNetwork.networkingPeer.photonViewList.Remove(viewID);
                    PhotonNetwork.UnAllocateViewID(viewID);
                }

                GameObject.Destroy(go);

                RegisterObjectDeletion(go, go.name);
            }
        }
All Usage Examples Of PhotonNetwork::UnAllocateViewID