static void ApplySpawnPayload(NetworkIdentity uv, Vector3 position, byte[] payload, NetworkInstanceId netId, GameObject newGameObject, string data = "") { if (!uv.gameObject.activeSelf) { uv.gameObject.SetActive(true); } uv.transform.position = position; if (payload != null && payload.Length > 0) { var payloadReader = new NetworkReader(payload); uv.OnUpdateVars(payloadReader, true); } if (newGameObject == null) { return; } newGameObject.SetActive(true); uv.SetNetworkInstanceId(netId); SetLocalObject(netId, newGameObject); // objects spawned as part of initial state are started on a second pass if (s_IsSpawnFinished) { uv.OnStartClient(); CheckForOwner(uv); } }
private static void ApplySpawnPayload(NetworkIdentity uv, Vector3 position, byte[] payload, NetworkInstanceId netId, GameObject newGameObject) { if (!uv.gameObject.activeSelf) { uv.gameObject.SetActive(true); } uv.transform.position = position; if (payload != null && payload.Length > 0) { NetworkReader reader = new NetworkReader(payload); uv.OnUpdateVars(reader, true); } if ((Object)newGameObject == (Object)null) { return; } newGameObject.SetActive(true); uv.SetNetworkInstanceId(netId); ClientScene.SetLocalObject(netId, newGameObject); if (!ClientScene.s_IsSpawnFinished) { return; } uv.OnStartClient(); ClientScene.CheckForOwner(uv); }
private static void ApplySpawnPayload(NetworkIdentity uv, Vector3 position, byte[] payload, NetworkInstanceId netId, GameObject newGameObject) { uv.transform.position = position; if (payload != null && payload.Length > 0) { NetworkReader reader = new NetworkReader(payload); uv.OnUpdateVars(reader, initialState: true); } if (!(newGameObject == null)) { newGameObject.SetActive(value: true); uv.SetNetworkInstanceId(netId); SetLocalObject(netId, newGameObject); if (s_IsSpawnFinished) { uv.OnStartClient(); CheckForOwner(uv); } } }
private static void ApplySpawnPayload(NetworkIdentity uv, Vector3 position, byte[] payload, NetworkInstanceId netId, GameObject newGameObject) { if (!uv.gameObject.activeSelf) uv.gameObject.SetActive(true); uv.transform.position = position; if (payload != null && payload.Length > 0) { NetworkReader reader = new NetworkReader(payload); uv.OnUpdateVars(reader, true); } if ((Object) newGameObject == (Object) null) return; newGameObject.SetActive(true); uv.SetNetworkInstanceId(netId); ClientScene.SetLocalObject(netId, newGameObject); if (!ClientScene.s_IsSpawnFinished) return; uv.OnStartClient(); ClientScene.CheckForOwner(uv); }
private static void ApplySpawnPayload(NetworkIdentity uv, Vector3 position, byte[] payload, NetworkInstanceId netId, GameObject newGameObject) { uv.transform.position = position; if ((payload != null) && (payload.Length > 0)) { NetworkReader reader = new NetworkReader(payload); uv.OnUpdateVars(reader, true); } if (newGameObject != null) { newGameObject.SetActive(true); uv.SetNetworkInstanceId(netId); SetLocalObject(netId, newGameObject); if (s_IsSpawnFinished) { uv.OnStartClient(); CheckForOwner(uv); } } }