void Awake() { // Create a layer mask for the Shootable layer. shootableMask = LayerMask.GetMask("Shootable") | LayerMask.GetMask("Obstacle"); // Set up the references. gunParticles = GetComponent <ParticleSystem> (); gunLine = GetComponent <LineRenderer> (); gunAudio = GetComponent <AudioSource> (); gunLight = GetComponent <Light> (); playerAttr = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerAttributesManager>(); anim = GameObject.FindGameObjectWithTag("Player").GetComponent <Animator>(); hudAnim = GameObject.FindGameObjectWithTag("HUD").GetComponent <Animator>(); playerRessources = GameObject.FindGameObjectWithTag("Player").GetComponent <RessourcesManager>(); //faceLight = GetComponentInChildren<Light> (); }
// Use this for initialization void Awake() { playerRessources = GameObject.FindGameObjectWithTag("Player").GetComponent <RessourcesManager>(); ammoAddText = GameObject.FindGameObjectWithTag("HUD").transform.Find("AmmoUI").Find("AmmoAddText").GetComponent <Text>(); hudAnim = GameObject.FindGameObjectWithTag("HUD").GetComponent <Animator>(); }