NetworkingPeer.GetInstantiatedObjectsId C# (CSharp) Method

GetInstantiatedObjectsId() public method

This returns -1 if the GO could not be found in list of instantiatedObjects.
public GetInstantiatedObjectsId ( GameObject go ) : int
go GameObject
return int
    public int GetInstantiatedObjectsId(GameObject go)
    {
        int id = -1;
        if (go == null)
        {
            Debug.LogError("GetInstantiatedObjectsId() for GO == null.");
            return id;
        }

        PhotonView[] pvs = go.GetPhotonViewsInChildren();
        if (pvs != null && pvs.Length > 0 && pvs[0] != null)
        {
            return pvs[0].instantiationId;
        }

        if (PhotonNetwork.logLevel >= PhotonLogLevel.Informational)
            UnityEngine.Debug.Log("GetInstantiatedObjectsId failed for GO: " + go);


        return id;
    }
NetworkingPeer