// Use this for initialization void Start() { ammo = 10; direction = 4; ammoNumber.text = ammo.ToString(); rb2d = GetComponent <Rigidbody2D>(); anim = GetComponent <Animator>(); playerHealth = GetComponent <PlayerHealth>(); playerAttack0 = GetComponentInChildren <PlayerAttack0>(); playerAttack1 = GetComponentInChildren <PlayerAttack1>(); playerAttack2 = GetComponentInChildren <PlayerAttack2>(); playerAttack3 = GetComponentInChildren <PlayerAttack3>(); }
// Use this for initialization void Start() { audioSource = GetComponent <AudioSource>(); thePlayer = GameObject.FindGameObjectWithTag("Player"); playerMovement = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMovement>(); enemyMovement = GetComponent <EnemyMovement>(); playerAttack0 = GameObject.FindGameObjectWithTag("Player").GetComponentInChildren <PlayerAttack0>(); playerAttack1 = GameObject.FindGameObjectWithTag("Player").GetComponentInChildren <PlayerAttack1>(); playerAttack2 = GameObject.FindGameObjectWithTag("Player").GetComponentInChildren <PlayerAttack2>(); playerAttack3 = GameObject.FindGameObjectWithTag("Player").GetComponentInChildren <PlayerAttack3>(); scoreManager = GameObject.FindGameObjectWithTag("Score").GetComponent <ScoreManager>(); rb2d = GetComponent <Rigidbody2D>(); collide = GetComponent <CapsuleCollider2D>(); trigger = GetComponentInChildren <CircleCollider2D>(); rend = GetComponent <Renderer>(); anim = GetComponent <Animator>(); currentHealth = health; }