private void Start() { gameObject.SetActive(true); fireworksControl = GetComponent <FireworksControl>(); gnomeStats = FindObjectOfType <GnomeStats>().GetGnomeStats(); if (weapon.Equals(GnomeWeapons.Firework)) { dmg = gnomeStats.fireworkDamage; } canDamage = true; if (weapon.Equals(GnomeWeapons.FishingRod)) { switch (rodType) { //case FishingRodAttack.Melee: // dmg = gnomeStats.fishingRodMeleeDamage; // break; case FishingRodAttack.Ranged: dmg = gnomeStats.fishingRodRangedDamage; break; default: break; } } ind = FindObjectOfType <DamageIndicator>(); }
private void Update() { if (gnome) { if (!activeWeapon.Equals(lastWeapon) || shouldUpdate) { switch (activeWeapon) { case GnomeWeapons.None: break; case GnomeWeapons.FishingRod: UpdateWeapon(weapons[1]); break; case GnomeWeapons.Umbrella: UpdateWeapon(weapons[2]); break; case GnomeWeapons.Firework: UpdateWeapon(weapons[3]); break; default: break; } if (shouldUpdate) { shouldUpdate = false; } } } }