// Start is called before the first frame update void Start() { // Define variables GM_Script = GameObject.Find("GameManager").GetComponent <GameManagerScript>(); Shoot_Script = GameObject.Find("Capsule/Gun").GetComponent <Shooting_Behaviour>(); }
// Start is called before the first frame update void Start() { // Define variables GM_Script = GameObject.Find("GameManager").GetComponent <GameManagerScript>(); // Define relevent variables if the active scene frim the build index is 1 if (SceneManager.GetActiveScene().buildIndex == 1) { Shoot_Script = GameObject.Find("Capsule/Gun").GetComponent <Shooting_Behaviour>(); HealthText = GameObject.Find("HealthText").GetComponent <Text>(); ArmourText = GameObject.Find("ArmourText").GetComponent <Text>(); AmmoText = GameObject.Find("AmmoText").GetComponent <Text>(); GunText = GameObject.Find("GunText").GetComponent <Text>(); Injured = GameObject.Find("Injured").GetComponent <RawImage>(); } }