// Start is called before the first frame update protected virtual void Start() { weapons = GetComponentsInChildren <Weapon>(); anim = GetComponentInParent <InputToAnimator>(); secondaryWeapons = new Weapon[weapons.Length - 1]; int j = 0; for (int i = 0; i < weapons.Length; i++) { if (weapons[i].GetComponent <Sword>()) { sword = weapons[i]; } else { secondaryWeapons[j] = weapons[i]; j++; } } currentSecondary = 0; if (secondaryWeapons.Length > 0) { secondaryWeaponImage.sprite = secondaryWeapons[currentSecondary].sprite; } }
protected virtual void Update() { if (!anim) { anim = GetComponentInParent <WeaponHolder>().anim; } }
protected virtual void Start() { pickedUp = true; anim = GetComponentInParent <WeaponHolder>().anim; if (GetComponentInParent <EnemyWeaponsHolder>()) { health = GetComponentInParent <EnemyWeaponsHolder>().health; } ready = true; }
// Start is called before the first frame update void Start() { obtainBWeapon = new bool[4] { true, true, true, true }; weaponSpecies = WeaponSpecies.Boomerang; animator = GetComponent <Animator>(); movement = GetComponent <ArrowKeyMovement>(); animatorInput = GetComponent <InputToAnimator>(); playerController = GetComponent <PlayerController>(); inventory = GetComponent <Inventory>(); }