void Start() { anim = GetComponent <Animator>(); body = GetComponent <Rigidbody2D>(); level = GameObject.Find("Level").GetComponent <Level>(); playerGun = level.GetCurrentHero().transform.FindChild("playerGun").GetComponent <Transform>(); playerControls = level.GetCurrentHero().GetComponent <ControlsHero>(); }
void Start() { playerBody = GameObject.FindGameObjectWithTag("Player").GetComponent <Rigidbody2D>(); playerControls = GameObject.FindGameObjectWithTag("Player").GetComponent <ControlsHero>(); }