private void CreateRegisteredObject(GameObject prefab, Vector3 position, Vector3 eulerAngles, NetworkConnection conn, out GameObject inst, out NetworkIdentity instIdentity)
        {
            inst = Object.Instantiate(prefab, position, Quaternion.Euler(eulerAngles));

            instIdentity = inst.GetComponent <NetworkIdentity>();

            NetworkIdentityManager.Instance.RegisterNetworkIdentity(instIdentity, conn);

            CreatedGameObject?.Invoke(instIdentity);

            RegisterObjectAsSpawned(inst);
        }
        private GameObject ClientInstantiateServerObject(int netID, Vector3 position, Quaternion rotation, GameObject prefab, NetworkConnection conn, byte[] customData)
        {
            GameObject      inst        = Object.Instantiate(prefab, position, rotation);
            NetworkIdentity netIdentity = inst.GetComponent <NetworkIdentity>();

            NetworkIdentityManager.Instance.RegisterNetworkIdentityManually(netIdentity, conn, netID);

            CreatedGameObject?.Invoke(netIdentity);
            RegisterObjectAsSpawned(inst);

            if (customData != null)
            {
                netIdentity.OnDeserialize(customData);
            }

            return(inst);
        }