Exemplo n.º 1
0
 internal static void Bind()
 {
     _beginDelegate    = Library.GetProcAddress <BeginDelegate>("mdbx_txn_begin") as BeginDelegate;
     _commitDelegate   = Library.GetProcAddress <CommitDelegate>("mdbx_txn_commit") as CommitDelegate;
     _abortDelegate    = Library.GetProcAddress <AbortDelegate>("mdbx_txn_abort") as AbortDelegate;
     _resetDelegate    = Library.GetProcAddress <ResetDelegate>("mdbx_txn_reset") as ResetDelegate;
     _renewDelegate    = Library.GetProcAddress <RenewDelegate>("mdbx_txn_renew") as RenewDelegate;
     _getTxnIdDelegate = Library.GetProcAddress <GetTxnIdDelegate>("mdbx_txn_id") as GetTxnIdDelegate;
 }
Exemplo n.º 2
0
    public void InitForUse(UpdateDelegate updateCallback, float delay, BeginDelegate beginCallback)
    {
        IsActive   = true;
        m_Progress = 0.0f;

        m_Delay    = delay;
        m_EaseType = EasingFunction.Ease.Linear;
        m_Speed    = 1;

        m_UpdateCallback = updateCallback;
        m_BeginCallback  = beginCallback;
        m_EndCallback    = null;
    }
Exemplo n.º 3
0
    // return false if finished (inactive)
    public bool Update(float timeStep)
    {
        if (m_Delay > 0.0f)
        {
            m_Delay -= timeStep;
            if (m_Delay < 0.0f)
            {
                if (m_BeginCallback != null)
                {
                    m_BeginCallback();
                }
                if (m_UpdateCallback != null)
                {
                    m_UpdateCallback(0);
                }
            }
        }
        else
        {
            m_Progress += timeStep * m_Speed;

            float tvalue = m_Progress;
            if (m_Progress > 1.0f)
            {
                tvalue = 1.0f;
            }
            float xvalue = EasingFunction.GetEasingFunction(m_EaseType)(0, 1, tvalue);
            if (m_UpdateCallback != null)
            {
                m_UpdateCallback(xvalue);
            }

            if (m_Progress > 1.0f)
            {
                if (m_EndCallback != null)
                {
                    m_EndCallback();
                }

                OnTerminateCallback.Invoke();

                IsActive         = false;
                m_UpdateCallback = null;
                m_EndCallback    = null;
                m_BeginCallback  = null;
            }
        }

        return(IsActive);
    }
Exemplo n.º 4
0
    public void InitForUse(UpdateDelegate updateCallback)
    {
        IsActive   = true;
        m_Progress = 0.0f;

        m_Delay    = -0.1f;
        m_EaseType = EasingFunction.Ease.Linear;
        m_Speed    = 1;

        m_UpdateCallback    = updateCallback;
        m_BeginCallback     = null;
        m_EndCallback       = null;
        OnTerminateCallback = delegate { };
        OnAbort             = delegate { };
    }
Exemplo n.º 5
0
 public Wait WaitOn(BeginDelegate begin)
 {
     _begin = begin;
     return(new Wait(this));
 }