// Start is called before the first frame update void Start() { rb = GetComponent <Rigidbody2D>(); switchState = GetComponent <SwitchState>(); healthBar = GameObject.Find("PlayerHealthBar").GetComponent <HealthBar>(); healthToEnrage = (int)Math.Ceiling((double)health / 2); healthBar.SetMaxSlider(health); //we set the slider's max value to the max value of player's health knightAttack = GameObject.Find("Knight").GetComponent <KnightAttack>(); hitSound = GameObject.Find("HitSound").GetComponent <AudioSource>(); healSound = GameObject.Find("HealSound").GetComponent <AudioSource>(); deathSound = GameObject.Find("DeathSound").GetComponent <AudioSource>(); }
// Start is called before the first frame update protected void Start() { preLocation = transform.position; enemyAnimator = GetComponent <Animator>(); knightAttack = transform.GetChild(0).GetComponent <KnightAttack>(); }
// Update is called once per frame public void Start() { sm = GameObject.FindGameObjectWithTag("Sound").GetComponent <SoundManager>(); knight = GameObject.FindGameObjectWithTag("Player").GetComponent <KnightAttack>(); manaUi = GameObject.Find("ManaUI").GetComponent <ManaUI>(); }