public void SpawnNetPlayerObj(GameObject playerPrefab, AiPathCtrl pathScript, Vector3 pos, Quaternion rot) { if (Network.peerType == NetworkPeerType.Disconnected) { return; } int playerID = int.Parse(Network.player.ToString()); GameObject obj = (GameObject)Network.Instantiate(playerPrefab, pos, rot, playerID); XkPlayerCtrl playerScript = obj.GetComponent <XkPlayerCtrl>(); playerScript.SetAiPathScript(pathScript); AddNpcObjList(obj); }