/// <summary> /// This will be plugged into the toggle's "OnValueChanged" property in the editor /// and called whenever the toggle is clicked. /// </summary> public void InventoryMenuItemWasToggled(bool isOn) { if (isOn) { InventoryMenuItemSelected?.Invoke(AssociatedInventoryObject); } }
public void InventoryMenuItemWasToggled(bool isActive) // To be used only by OnValueChanged { if (isActive) { InventoryMenuItemSelected?.Invoke(AssociatedInventoryObject); } }
/// <summary> /// This will be plugged into the toggle's "OnValueChanged" property in the editory /// and called whenever the toggle is clicked /// </summary> public void InventoryMenuItemWasToggled(bool isOn) { //We only want to do this when the toggle is selected. if (isOn) { InventoryMenuItemSelected?.Invoke(AssociatedInventoryObject); } }
/// <summary> /// This will be plugged into toggles on value changed property in editor and called when toggle is clicked /// </summary> public void InventoryItemWasToggled(bool isOn) { if (isOn) { InventoryMenuItemSelected?.Invoke(AssociatedInventoryObject); } Debug.Log($"toggled:{isOn}"); }
/// <summary> /// this will be plugged into the toggles in the edditor /// it will be called on toggle clicked /// </summary> public void InventoryMenuItemWasToggled(bool isOn) { //only do stuff if the toggle has been selected if (isOn) { InventoryMenuItemSelected?.Invoke(AssociatedInventoryObject); } }
/// <summary> /// This will be plugged into the on value changed property in the editor /// and will be called when ever toggle is clicked. /// </summary> public void InventoryMenuItemWasToggled(bool isOn) { //Only do when toggle is selected. if (isOn) { InventoryMenuItemSelected?.Invoke(AssociatedInventoryObject); } }
/// <summary> /// This will be plugged into the toggle's "OnValueChanged" property in the editor /// and called whenever the toggle is clicked /// </summary> public void InventoryMenuWasToggled(bool isOn) { //We only want to do the stuff when the toggle has been selected. Not when it has been deselected. if (isOn) { InventoryMenuItemSelected?.Invoke(AssociatedInventoryObject); } Debug.Log($"Toggled: {isOn}. "); }
/// <summary> /// This will be plugged into the toggle's "OnValueChanged" property in the editor /// and called whenever the toggle is clicked /// </summary> public void InventoryMenuItemWasToggled(bool isOn) { audioSourceButton.Play(); //We only want to do anything when the toggle is selected if (isOn) { InventoryMenuItemSelected?.Invoke(AssociatedInventoryObject); } }
/// <summary> /// this will be plugged into the onvalu changed function of the toggle to update information /// </summary> public void InventoryItemWasToggled(bool isOn) { //only proceed when toggle is selected, not when deselected Debug.Log("Toggled: " + isOn); if (isOn) { audioSource.Play(); InventoryMenuItemSelected?.Invoke(linkedObject); } }