void SpawnShip() { if (GameObject.FindGameObjectWithTag("Player")) { return; } if (SceneManager.GetActiveScene().name.Equals("EventsMap")) { PlayerInformationData pid = transform.root.GetComponent <PlayerInformationData>(); GameObject go = null; if (pid) { go = pid.getShip(); } else { Debug.Log("Missing pid"); } if (go) { spawnedShip = Instantiate(go, Vector3.zero, Quaternion.identity) as GameObject; } else { Debug.Log("Failed loading ship " + basePath + SpacePath); } } }
void findpid() { if (!playerinfodata) { playerinfodata = GameObject.Find("MasterObject").GetComponent <PlayerInformationData>(); } }