/// <summary> /// Toggles the active weapon as needed /// </summary> private void ToggleActiveWeapon() { if (input.Gnome.ToggleWeaponOne.phase == InputActionPhase.Performed) { activeWeapon = GnomeWeapons.FishingRod; } if (input.Gnome.ToggleWeaponTwo.phase == InputActionPhase.Performed) { activeWeapon = GnomeWeapons.Umbrella; } if (input.Gnome.ToggleWeaponThree.phase == InputActionPhase.Performed) { activeWeapon = GnomeWeapons.Firework; } // update the weapon stats if (weaponUI) { weaponUI.SendUpdatedWeaponStats(); } }
/// <summary> /// Forces the UI to update even if the weapon has not changed. /// </summary> public void ForceWeaponUIUpdate() { lastWeapon = activeWeapon; activeWeapon = gnome.GetActiveWeapon(); shouldUpdate = true; }
/// <summary> /// Gets up to date values on the active weapon, should only be called when the user changes a weapon... /// </summary> public void SendUpdatedWeaponStats() { lastWeapon = activeWeapon; activeWeapon = gnome.GetActiveWeapon(); }
private void Start() { activeWeapon = gnome.GetActiveWeapon(); UpdateWeapon(weapons[1]); }
/// <summary> /// Sets the active weapon to what is inputted /// </summary> /// <param name="newWeapon">GnomeWeapon to change to. (0 = none, 1 = rod, 2 = um, 3 = fire)</param> public void SetGnomeWeapon(int newWeapon) { activeWeapon = (GnomeWeapons)newWeapon; }