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;
}