void Start() { DontDestroyOnLoad(this.gameObject); DontDestroyOnLoad(GameObject.FindGameObjectWithTag("PlayerUI")); rigidbody = this.GetComponent <Rigidbody2D>(); equippedWeapon = this.transform.GetChild(0).GetComponent <DualPistolsBehaviour>(); healthText = GameObject.FindGameObjectWithTag("PlayerUI").transform.Find("HealthPanel").Find("HealthText").GetComponent <Text>(); }
private void Start() { player = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerController>(); pistols = player.transform.GetChild(0).GetComponent <DualPistolsBehaviour>(); }