Beispiel #1
0
    void OnEnable()
    {
        var _actions = Game.Instance.RequestActionMap <T>();

        if (_actions.HasValue)
        {
            SetCallbacks(_actions.Value, this);
            DisableInputActions = () => {
                SetCallbacks(_actions.Value, null);
                Game.Instance.DisableActionMap <T>();
            };
        }
        else
        {
            enabled = false;
        }
        OnEnableCallback?.Invoke(this, _actions);
    }
Beispiel #2
0
 void OnEnable() => OnEnableCallback?.Invoke();