suspend character in menu.

Absent83

Member
Halo Justin!

I need to suspend character! What do I mean?

When game is paused and player see menu, player can buy or change ItemTypes (weapons)
If I set character SetActive(false) or somethig like this, inventory do not properly work (PickupItemType method).

So I need completely suspend character except inventory.

Or It seems to me that I can switch off input component, to prevent any character activity.

So what and do you reccomend to do and how.

Thank you!
 
Thank you for the help!

Is there an oppotunity to execute equip and other abilities in one frame without playing animations?

For example, if I press in menu button eqiup or unequip and then immediately run game, will corresponding animation and ability at all complete?
 
If you call EquipUnequip.StartEquipUnequip(index, true) then it will force the items to be updated to that item set index. This method is used when the character dies or respawns so if you search the code you'll find some examples of it being used.
 
Thank you, Justin!

I extend your class, but I think, that you can implement this checkbox in the EquipUnequip class in futuer updates :)


C#:
public class EquipUnequipExt : EquipUnequip
{
    [SerializeField] private bool _disableAnimtionsOnPlayerInpuntDisable;


    /// <summary>
    /// Initialize the default values.
    /// </summary>
    public override void Awake()
    {
        base.Awake();

        EventHandler.RegisterEvent<bool>(m_GameObject, "OnEnableGameplayInput", SetImmediateEquipUnequip);
    }


    private void SetImmediateEquipUnequip(bool enable)
    {
        m_ImmediateEquipUnequip = enable;
    }



    /// <summary>
    /// Called when the character is destroyed.
    /// </summary>
    public override void OnDestroy()
    {
        base.OnDestroy();

        EventHandler.UnregisterEvent<bool>(m_GameObject, "OnEnableGameplayInput", SetImmediateEquipUnequip);
    }
}
 
Justin, is there any other oppotunity to prevent Equip / Unequip animations during Inventory`s items is changing?

May be I can swith off EquipUnequip ability in Menu and then switch on it in game?

Will the change in inventory content have a bad affect on properly operation of UCC in this casw (switched off EquipUnequip ability) ?
 
Top